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