12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
#ifndef __CLILOC_H__ #define __CLILOC_H__ #include <string> #include <vector> #include <list> #include <SDL/SDL_types.h> enum classes{ locForm = 0x464f524d, locInfo = 0x494e464f, locText = 0x54455854, locTime = 0x54494d45, locName = 0x4e414d45, locData = 0x44415441, locLang = 0x4c414e47 }; // temporary function // TODO: design normla Unicode system void latin2unicode(string , string &); class ClInfo { public: ClInfo(); virtual ~ClInfo(); virtual Uint32 load(Uint8 *); virtual Uint16 getLangNumItems(); protected: Uint8 *data; Uint32 size; }; class ClLangInfo : public ClInfo { public: ClLangInfo(); ~ClLangInfo(); Uint32 load(Uint8 *); Uint16 getLangNumItems(); private: string language; string formClass; Uint8 bytesPerChar; Uint16 numberItems; }; class ClText { public: ClText(); virtual ~ClText(); Uint32 load(Uint8 *); string *getString(Uint16); private: vector<string>text; }; class ClForm { public: ClForm(); virtual ~ClForm(); virtual Uint32 load(Uint8 *); virtual string *getString(Uint16); private: list<class ClForm *>forms; }; class ClDataForm : public ClForm { public: ClDataForm(); ~ClDataForm(); Uint32 load(Uint8 *); string *getString(Uint16); private: list<ClInfo *>infos; ClText * text; }; class Cliloc { public: Cliloc(string formClass); ~Cliloc(); string &getString(Uint16 index); private: list<ClForm *>forms; string str; }; #endif