ULAPI  8.0
uljsondictionaryiterator.h
1 
7 #ifndef ULJSONDICTIONARYITERATOR_H
8 #define ULJSONDICTIONARYITERATOR_H
9 
10 #include "uldictionarydatasourceiterator.h"
11 #include "ullanguage.h"
12 #include "json/json.h"
13 
19 class ULJSONDictionaryIterator : public ULDictionaryDataSourceIterator
20 {
21  UL_TEST_FRIEND;
23 
24 public:
27  virtual ~ULJSONDictionaryIterator();
28 
30  virtual void clear();
31 
32  virtual ULDictionaryDataSourceIterator *clone() const;
33 
34  virtual const ULDictionaryNode& operator*();
35  virtual void operator++();
36  virtual void operator--();
37 
38  virtual uluint32 hash(uluint32 tableSize) const;
39  virtual bool operator==(const ULDictionaryDataSourceIterator& iterator) const;
40  virtual bool operator==(const ULJSONDictionaryIterator& iterator) const;
41 
42  virtual void toNextTopLevelNode();
43  virtual void toCurrentTopLevelNode();
44  virtual void toPreviousTopLevelNode();
45  virtual bool hasParent();
46  virtual void toParent();
47  virtual bool hasChildren();
48  virtual void toFirstChild();
49  virtual bool hasNextSibling();
50  virtual void toNextSibling();
51  virtual bool hasPreviousSibling();
52  virtual void toPreviousSibling();
53  virtual bool hasNextCousin();
54  virtual void toNextCousin();
55  virtual bool hasPreviousCousin();
56  virtual void toPreviousCousin();
57  virtual int getLevel();
58  virtual uluint32 getType();
59  virtual bool isAtEnd() const;
60  virtual bool isAtBeginning() const;
61  virtual bool isInFirstTree() const;
62  virtual bool isInLastTree() const;
63  virtual ULString getIndexKey();
64  virtual const ULLanguage& getLanguage() const;
65  virtual void setLanguage(const ULLanguage& language);
66  virtual const ULLanguage& getSearchLanguage() const;
67  virtual const ULLanguage& getTranslationLanguage() const;
68 
69 protected:
70  struct JSONNodeInfo
71  {
72  uluint32 childIndex;
74  Json::Value jsonNode;
75 
76  JSONNodeInfo();
77  JSONNodeInfo(uluint32 index, uluint32 nChildren, const Json::Value& node);
78  };
79 
84 
85  void lockDataSource() const;
86  void unlockDataSource() const;
87  void loadCurrentNode();
88 };
89 
90 #endif
91