Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Class Members | File Members

FileTypeClassifier Class Reference

#include <FileTypeClassifier.h>

List of all members.

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


Member Enumeration Documentation

enum FileTypeClassifier::FILE_SUBTYPE
 

Enumerator:
XML_MS 
XML_OO 
XML_HTML 
XML_MADELINE 
UNKNOWN_SUBTYPE 

enum FileTypeClassifier::FILE_TYPE
 

Enumerator:
BZIP2 
GZIP 
XML 
PKZIP 
UTF8 
UNKNOWN_TYPE 


Constructor & Destructor Documentation

FileTypeClassifier::FileTypeClassifier const char *  fileName = 0  ) 
 


Member Function Documentation

bool FileTypeClassifier::_readHeaderIntoBuffer const char *  fileName  )  [private]
 

bool FileTypeClassifier::checkFileSubType const char *  flag  ) 
 

enum FileTypeClassifier::FILE_TYPE FileTypeClassifier::classify void   ) 
 

classify(): returns an enumerated value for the file type:

const char * FileTypeClassifier::classifyByName void   ) 
 

classifyByName(): returns a string representation of the file type:

enum FileTypeClassifier::FILE_SUBTYPE FileTypeClassifier::getFileSubType  ) 
 

bool FileTypeClassifier::setFileToTest const char *  fileName  ) 
 

enum FileTypeClassifier::FILE_TYPE FileTypeClassifier::testUTF8  )  [private]
 


Member Data Documentation

char FileTypeClassifier::_buffer[BUFFER_SIZE+1] [private]
 

int FileTypeClassifier::_bytesToTest [private]
 

FILE_TYPE FileTypeClassifier::_type [private]
 

char FileTypeClassifier::_xmlBuffer[XML_BUFFER_SIZE+1] [private]
 

const int FileTypeClassifier::BUFFER_SIZE = 1024 [static, private]
 

const char FileTypeClassifier::UTF8_CONTINUATION_BYTE_MASK = 0xC0 [static, private]
 

const char FileTypeClassifier::UTF8_CONTINUATION_BYTE_PATTERN = 0x80 [static, private]
 

const int FileTypeClassifier::XML_BUFFER_SIZE = 26 [static, private]
 


The documentation for this class was generated from the following files:
Generated on Fri Nov 18 16:24:39 2011 for MADELINE by  doxygen 1.4.4