DriverConfigInfo.tli 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. #include "stdafx.h"
  3. #include "DriverConfigInfo.tlh"
  4. #include "ResDataObject.h"
  5. //-----------------------------------------------------------------------------
  6. // ConfigInfo
  7. //-----------------------------------------------------------------------------
  8. ConfigInfo::ConfigInfo (const char* Key, const char* strType, const char* strAccess, const char* strRequired, const char* strDefaultValue)
  9. {
  10. strConfKey = Key;
  11. ResDataObject temp;
  12. temp.update ("Type", strType);
  13. temp.update ("Access", strAccess);
  14. temp.update ("Required", strRequired);
  15. temp.update ("DefaultValue", strDefaultValue);
  16. resDescription = temp.encode ();
  17. }
  18. ConfigInfo::~ConfigInfo ()
  19. {
  20. }
  21. void ConfigInfo::SetList (const char* str)
  22. {
  23. ResDataObject temp;
  24. temp.decode (resDescription.c_str ());
  25. temp.update ("List", str);
  26. resDescription = temp.encode ();
  27. }
  28. void ConfigInfo::SetRange (const char* strmin, const char* strmax)
  29. {
  30. ResDataObject temp;
  31. temp.decode (resDescription.c_str ());
  32. temp.update ("RangeMin", strmin);
  33. temp.update ("RangeMax", strmax);
  34. resDescription = temp.encode ();
  35. }
  36. const char* ConfigInfo::GetDescription ()
  37. {
  38. return resDescription.c_str ();
  39. }
  40. const char* ConfigInfo::GetCurrentValue ()
  41. {
  42. return resValue.c_str ();
  43. }
  44. void ConfigInfo::SetCurrentValue (const char* res)
  45. {
  46. resValue = res;
  47. }
  48. const char* ConfigInfo::GetKey ()
  49. {
  50. return strConfKey.c_str ();
  51. }