outputFlag.hh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. * outputFlag.hh for jsonstroller
  3. *
  4. * Author: isundil <isundill@gmail.com>
  5. **/
  6. #pragma once
  7. enum eLevenshteinOperator: char
  8. {
  9. add = '+',
  10. rem = '-',
  11. mod = '!',
  12. equ = '='
  13. };
  14. class OutputFlag
  15. {
  16. public:
  17. OutputFlag(short mode =0);
  18. virtual ~OutputFlag();
  19. /**
  20. * get/set SELECTED byte
  21. **/
  22. bool selected() const;
  23. bool selected(bool v);
  24. /**
  25. * get/set SEARCH byte
  26. **/
  27. bool searched() const;
  28. bool searched(bool v);
  29. /**
  30. * get/set item's type
  31. **/
  32. char type() const;
  33. char type(char t);
  34. /**
  35. * get/set item's diff operation
  36. **/
  37. eLevenshteinOperator diffOp() const;
  38. eLevenshteinOperator diffOp(const eLevenshteinOperator &);
  39. protected:
  40. /**
  41. * item mode bitmask
  42. **/
  43. short mode;
  44. /**
  45. * item type
  46. **/
  47. char _type;
  48. eLevenshteinOperator diffOpt;
  49. public:
  50. static const short MODE_SELECTED = 1;
  51. static const short MODE_SEARCHED = 2;
  52. static const char TYPE_UNKNOWN;
  53. static const char TYPE_STRING;
  54. static const char TYPE_NUMBER;
  55. static const char TYPE_BOOL;
  56. static const char TYPE_OBJ;
  57. static const char TYPE_OBJKEY;
  58. static const char TYPE_ARR;
  59. static const char TYPE_NULL;
  60. static const char SPECIAL_NONE;
  61. static const char SPECIAL_SEARCH;
  62. static const char SPECIAL_ERROR;
  63. static const char SPECIAL_INPUTNAME;
  64. static const char SPECIAL_ACTIVEINPUTNAME;
  65. static const char DIFF_ADD;
  66. static const char DIFF_MOD;
  67. static const char DIFF_REM;
  68. };