1 // Common/Lang.h 2 3 #ifndef ZIP7_INC_COMMON_LANG_H 4 #define ZIP7_INC_COMMON_LANG_H 5 6 #include "MyString.h" 7 8 class CLang 9 { 10 wchar_t *_text; 11 12 bool OpenFromString(const AString &s); 13 public: 14 CRecordVector<UInt32> _ids; 15 CRecordVector<UInt32> _offsets; 16 UStringVector Comments; 17 CLang()18 CLang(): _text(NULL) {} ~CLang()19 ~CLang() { Clear(); } 20 bool Open(CFSTR fileName, const char *id); 21 void Clear() throw(); IsEmpty()22 bool IsEmpty() const { return _ids.IsEmpty(); } 23 const wchar_t *Get(UInt32 id) const throw(); Get_by_index(unsigned index)24 const wchar_t *Get_by_index(unsigned index) const throw() 25 { 26 return _text + (size_t)_offsets[index]; 27 } 28 }; 29 30 #endif 31