aboutsummaryrefslogtreecommitdiff
path: root/CPP/Common/Lang.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--CPP/Common/Lang.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/CPP/Common/Lang.h b/CPP/Common/Lang.h
index cc66677..76d5418 100644
--- a/CPP/Common/Lang.h
+++ b/CPP/Common/Lang.h
@@ -1,23 +1,30 @@
1// Common/Lang.h 1// Common/Lang.h
2 2
3#ifndef __COMMON_LANG_H 3#ifndef ZIP7_INC_COMMON_LANG_H
4#define __COMMON_LANG_H 4#define ZIP7_INC_COMMON_LANG_H
5 5
6#include "MyString.h" 6#include "MyString.h"
7 7
8class CLang 8class CLang
9{ 9{
10 wchar_t *_text; 10 wchar_t *_text;
11 CRecordVector<UInt32> _ids;
12 CRecordVector<UInt32> _offsets;
13 11
14 bool OpenFromString(const AString &s); 12 bool OpenFromString(const AString &s);
15public: 13public:
16 CLang(): _text(0) {} 14 CRecordVector<UInt32> _ids;
15 CRecordVector<UInt32> _offsets;
16 UStringVector Comments;
17
18 CLang(): _text(NULL) {}
17 ~CLang() { Clear(); } 19 ~CLang() { Clear(); }
18 bool Open(CFSTR fileName, const char *id); 20 bool Open(CFSTR fileName, const char *id);
19 void Clear() throw(); 21 void Clear() throw();
22 bool IsEmpty() const { return _ids.IsEmpty(); }
20 const wchar_t *Get(UInt32 id) const throw(); 23 const wchar_t *Get(UInt32 id) const throw();
24 const wchar_t *Get_by_index(unsigned index) const throw()
25 {
26 return _text + (size_t)_offsets[index];
27 }
21}; 28};
22 29
23#endif 30#endif