12 #ifndef ossimKeywordlist_HEADER 13 #define ossimKeywordlist_HEADER 1 26 static const char DEFAULT_DELIMITER =
':';
60 bool expandEnvVars =
false);
63 char delimiter = DEFAULT_DELIMITER,
64 bool ignoreBinaryChars =
false,
65 bool expandEnvVars =
false );
68 char delimiter = DEFAULT_DELIMITER,
69 bool ignoreBinaryChars =
false,
70 bool expandEnvVars =
false);
80 bool addFile(
const char* file);
92 void change_delimiter(
char del);
100 void setExpandEnvVarsFlag(
bool flag );
105 bool getExpandEnvVarsFlag(
void )
const;
107 void add(
const char* prefix,
109 bool overwrite=
true);
137 template<
class CompareType>
140 KeywordMap::const_iterator iter = std::find_if(m_map.begin(), m_map.end(), compare);
141 bool result = (iter != m_map.end());
142 if(result) value = iter->second;
154 return result.
c_str();
158 void addPair(
const std::string& key,
159 const std::string& value,
160 bool overwrite =
true);
162 void addPair(
const std::string& prefix,
163 const std::string& key,
164 const std::string& value,
165 bool overwrite =
true);
173 const char* prefix=0,
174 bool stripPrefix=
true);
176 void add(
const char* key,
178 bool overwrite =
true);
180 void add(
const char* prefix,
183 bool overwrite =
true);
185 void add(
const char* key,
187 bool overwrite =
true);
189 void add(
const char* prefix,
192 bool overwrite =
true);
194 void add(
const char* key,
196 bool overwrite =
true);
198 void add(
const char* prefix,
201 bool overwrite =
true);
203 void add(
const char* key,
205 bool overwrite =
true);
207 void add(
const char* prefix,
210 bool overwrite =
true);
212 void add(
const char* key,
214 bool overwrite =
true);
216 void add(
const char* prefix,
219 bool overwrite =
true);
221 void add(
const char* key,
223 bool overwrite =
true);
225 void add(
const char* prefix,
228 bool overwrite =
true);
230 void add(
const char* key,
232 bool overwrite =
true);
234 void add(
const char* prefix,
237 bool overwrite =
true);
239 void add(
const char* key,
241 bool overwrite =
true);
243 void add(
const char* prefix,
246 bool overwrite =
true);
262 void add(
const char* key,
264 bool overwrite =
true,
281 void add(
const char* prefix,
284 bool overwrite =
true,
301 void add(
const char* key,
303 bool overwrite =
true,
320 void add(
const char* prefix,
323 bool overwrite =
true,
334 bool hasKey(
const std::string& key )
const;
345 const std::string& findKey(
const std::string& key)
const;
346 const std::string& findKey(
const std::string& prefix,
347 const std::string& key)
const;
349 const char* find(
const char* key)
const;
350 const char* find(
const char* prefix,
351 const char* key)
const;
353 void remove(
const char * key);
354 void remove(
const char* prefix,
const char * key);
375 ossim_uint32 numberOf(
const char* prefix,
const char* key)
const;
386 virtual bool write(
const char* file,
const char* comment = 0)
const;
398 void toXML(
std::ostream &out,
const std::string& rootTag=
"info")
const;
405 void toJSON(
std::ostream &out,
const std::string& rootTag=
"info")
const;
432 bool ignoreBinaryChars);
435 virtual bool parseString(
const std::string& inString);
455 void getSortedList(std::vector<ossimString>& prefixValues,
462 std::vector<ossimString> findAllKeysThatContains(
473 void findAllKeysThatMatch( std::vector<ossimString>& result,
487 void removeKeysThatMatch(
const ossimString ®ularExpression);
512 std::vector<ossimString> getSubstringKeyList(
const ossimString& regularExpression)
const;
513 void getSubstringKeyList(std::vector<ossimString>& result,
520 void addPrefixToKeysThatMatch(
const ossimString& prefix,
522 void stripPrefixFromAll(
const ossimString& regularExpression);
543 bool getBoolKeywordValue(
bool& rtn_val,
545 const char* prefix=0)
const;
550 KeywordlistParseState_OK = 0,
553 KeywordlistParseState_FAIL = 1,
556 KeywordlistParseState_BAD_STREAM = 2,
567 bool ignoreBinaryChars =
false);
569 bool isValidKeywordlistCharacter(
ossim_uint8 c)
const;
575 KeywordlistParseState readKeyAndValuePair(
ossimString& key,
579 KeywordMap::iterator getMapEntry(
const std::string& key);
580 KeywordMap::iterator getMapEntry(
const ossimString& key);
581 KeywordMap::iterator getMapEntry(
const char* key);
584 bool isSpecialXmlCharacters(
const ossimString& value)
const;
585 bool isValidTag(
const std::string& value)
const;
586 void replaceSpecialCharacters(
ossimString& value)
const;
591 bool isSame(
const std::vector<ossimString>& a,
592 const std::vector<ossimString>& b )
const;
bool operator!=(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
Represents serializable keyword/value map.
ossimReferenced allows for shared object ref counting if the reference count ever gets to 0 or less i...
virtual std::ostream & print(std::ostream &out) const
Outputs theErrorStatus as an ossimErrorCode and an ossimString.
unsigned short ossim_uint16
std::map< std::string, std::string > KeywordMap
std::string operator[](const std::string &key) const
unsigned long long ossim_uint64
bool findValue(ossimString &value, const CompareType &compare) const
This is a generic find method that takes a comparator type and iterates through the map executing t...
unsigned int ossim_uint32
bool operator==(const ossimRefPtr< _Tp1 > &__a, const ossimRefPtr< _Tp2 > &__b) noexcept
std::string & operator[](const std::string &key)
std::basic_istream< char > istream
Base class for char input streams.
static const std::string NULL_KW
friend OSSIMDLLEXPORT std::ostream & operator<<(std::ostream &out, const ossimErrorStatusInterface &obj)
ossimFilename m_currentlyParsing
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
str write(os2.str().data(), os2.str().size())
unsigned char ossim_uint8
std::basic_ostream< char > ostream
Base class for char output streams.