prefline.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. ////////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2016 RWS Inc, All Rights Reserved
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of version 2 of the GNU General Public License as published by
  7. // the Free Software Foundation
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU General Public License along
  15. // with this program; if not, write to the Free Software Foundation, Inc.,
  16. // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. //
  18. // prefline.h
  19. //
  20. // 12/11/96 JPW RPrefsLine created to contain ini file lines, information
  21. // on the type of lines, and to help in processing of lines.
  22. // 12/16/96 JPW Fixed so it will work with the STL stuff that comes with
  23. // MSVC 4.1 or newer. Also fixed a few psz parameters that
  24. // should have been const's.
  25. //
  26. // 03/28/97 JMI Fixed so this'll work with MSVC 4.2.
  27. //
  28. // 05/17/97 JMI Fixed so this'll work with MSVC 5.0 (removed rhetorical
  29. // RPrefsLine:: namespace name.
  30. //
  31. // 06/29/97 MJR Replaced STL vector with an RSP list. STL is an evil
  32. // entity that should be banished from the face of the earth.
  33. // Whoever suggested we use it should be shot. (Good thing
  34. // I'm the president -- it's against the rules to shoot me.)
  35. //
  36. ////////////////////////////////////////////////////////////////////////////////
  37. #ifndef PREFLINE_H
  38. #define PREFLINE_H
  39. #include "Blue.h"
  40. #ifdef PATHS_IN_INCLUDES
  41. #include "ORANGE/CDT/flist.h"
  42. #else
  43. #include "flist.h"
  44. #endif
  45. class RPrefsLine;
  46. typedef RFList<RPrefsLine*> RPrefsLineList;
  47. class RPrefsLine
  48. {
  49. public:
  50. typedef enum ePrefsLineType
  51. {
  52. Comment,
  53. Section,
  54. Variable
  55. };
  56. private:
  57. ePrefsLineType m_Type; // Type of line read from ini file
  58. char *m_pszLine; // Line read from ini file
  59. public:
  60. // Constructor.
  61. RPrefsLine (ePrefsLineType Type, const char *pszLine);
  62. // Destructor
  63. ~RPrefsLine ();
  64. // Get a constant pointer to the Line of text.
  65. const char* GetLine (void);
  66. // Get type of line.
  67. RPrefsLine::ePrefsLineType GetType();
  68. // Get the section name
  69. short GetSectionName(char *pszSection);
  70. // Get the variable name
  71. short GetVariableName(char *pszVariable);
  72. // Get the value of the variable
  73. short GetVariableValue(char *pszValue);
  74. // Set the value of the variable
  75. short SetVariableValue(const char *pszValue);
  76. };
  77. #endif//PREFLINE_H