12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #pragma once
- #include <string>
- #include "ResDataObject.h"
- #pragma warning (disable:4251)
- class ConfigInfo
- {
- public:
- ConfigInfo(const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue)
- {
- strConfKey = Key;
- ResDataObject temp;
- temp.update("Type", strType);
- temp.update("Access", strAccess);
- temp.update("Required", strRequired);
- temp.update("DefaultValue", strDefaultValue);
- resDescription = temp.encode();
- };
- virtual ~ConfigInfo() {};
- void ConfigInfo::SetList(const char* str)
- {
- ResDataObject temp;
- temp.decode(resDescription.c_str());
- temp.update("List", str);
- resDescription = temp.encode();
- };
- void ConfigInfo::SetRange(const char* strmin, const char* strmax)
- {
- ResDataObject temp;
- temp.decode(resDescription.c_str());
- temp.update("RangeMin", strmin);
- temp.update("RangeMax", strmax);
- resDescription = temp.encode();
- };
- const char* ConfigInfo::GetDescription()
- {
- return resDescription.c_str();
- };
- const char* ConfigInfo::GetCurrentValue()
- {
- return resValue.c_str();
- };
- void ConfigInfo::SetCurrentValue(const char* res)
- {
- resValue = res;
- };
- const char* ConfigInfo::GetKey()
- {
- return strConfKey.c_str();
- };
- private:
- std::string strConfKey;
- std::string resValue;
- std::string resDescription;
- };
|