Line data Source code
1 : #ifndef ERSHDRNODE_H_INCLUDED 2 : #define ERSHDRNODE_H_INCLUDED 3 : 4 : #include "cpl_string.h" 5 : 6 : class ERSHdrNode; 7 : 8 : class ERSHdrNode 9 : { 10 : CPLString osTempReturn{}; 11 : 12 : void MakeSpace(); 13 : 14 : public: 15 : int nItemMax = 0; 16 : int nItemCount = 0; 17 : char **papszItemName = nullptr; 18 : char **papszItemValue = nullptr; 19 : ERSHdrNode **papoItemChild = nullptr; 20 : 21 284 : ERSHdrNode() = default; 22 : ~ERSHdrNode(); 23 : 24 : int ParseHeader(VSILFILE *fp); 25 : int ParseChildren(VSILFILE *fp, int nRecLevel = 0); 26 : int WriteSelf(VSILFILE *fp, int nIndent); 27 : 28 : const char *Find(const char *pszPath, const char *pszDefault = nullptr); 29 : const char *FindElem(const char *pszPath, int iElem, 30 : const char *pszDefault = nullptr); 31 : ERSHdrNode *FindNode(const char *pszPath); 32 : 33 : void Set(const char *pszPath, const char *pszValue); 34 : 35 : private: 36 : static int ReadLine(VSILFILE *, CPLString &); 37 : 38 : CPL_DISALLOW_COPY_ASSIGN(ERSHdrNode) 39 : }; 40 : 41 : #endif /* ERSHDRNODE_H_INCLUDED */