#include <FileTypeClassifier.h>
Public Types | |
enum | FILE_TYPE { BZIP2, GZIP, XML, PKZIP, UTF8, UNKNOWN_TYPE } |
enum | FILE_SUBTYPE { XML_MS, XML_OO, XML_HTML, XML_MADELINE, UNKNOWN_SUBTYPE } |
Public Member Functions | |
FileTypeClassifier (const char *fileName=0) | |
enum FILE_TYPE | classify (void) |
const char * | classifyByName (void) |
bool | setFileToTest (const char *fileName) |
enum FILE_SUBTYPE | getFileSubType () |
bool | checkFileSubType (const char *flag) |
Private Member Functions | |
bool | _readHeaderIntoBuffer (const char *fileName) |
enum FILE_TYPE | testUTF8 () |
Private Attributes | |
char | _buffer [BUFFER_SIZE+1] |
char | _xmlBuffer [XML_BUFFER_SIZE+1] |
int | _bytesToTest |
FILE_TYPE | _type |
Static Private Attributes | |
static const int | BUFFER_SIZE = 1024 |
static const int | XML_BUFFER_SIZE = 26 |
static const char | UTF8_CONTINUATION_BYTE_MASK = 0xC0 |
static const char | UTF8_CONTINUATION_BYTE_PATTERN = 0x80 |
|
|
|
|
|
|
|
|
|
|
|
classify(): returns an enumerated value for the file type: |
|
classifyByName(): returns a string representation of the file type: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|