#pragma once #include #include #include "DllDefines.h" typedef std::pair myKeyValPair; class UTILITYDLL CKeyValue { public: CKeyValue(void); ~CKeyValue(void); std::vector splitspaces(const std::string& s); std::vector split(const std::string& s, char separator, bool bSinglePair = false); std::vector split(const std::vector& vecLine, char chSeparator); std::vector splitKeyValPair(const std::vector& vecLine, char chSeparator); bool getKeyVal(const std::vector& vecKeyValPair, const std::string& strKeyName, std::string& strValue); std::vector::iterator getKeyVal(const std::vector::iterator& itBegin, const std::vector::iterator& itEnd, const std::string& strKeyName, std::string& strValue); bool isValueExist(std::vector& vecKeyValPair, const std::string& strKeyName, const std::string& strTargetValue); std::vector splitfile(const std::string& strFileName, char chSeparator); std::string splitnext(std::string& s, char chSeparator); private: std::string& ltrim(std::string& str); std::string& rtrim(std::string& str); std::string& trim(std::string& str); };