Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.0 KiB

  1. #ifndef ANALISYS_RESULTS_HPP
  2. #define ANALISYS_RESULTS_HPP
  3. #include "global.hpp"
  4. using namespace std;
  5. // This file contains the data structure with the analisys results
  6. struct ObjectId
  7. {
  8. long locale;
  9. String object;
  10. ObjectId(long locale_,String &object_):
  11. locale(locale_),object(object_) {};
  12. // The operator below is necessary for structs
  13. // to be map keys. It ends up defining the order
  14. // in which the ldiff entries will appear, i.e.
  15. // first by locale and then by object.
  16. bool operator < (const ObjectId& idArg) const
  17. {
  18. return (idArg.locale > locale) ||
  19. (idArg.object > object);
  20. }
  21. };
  22. struct ValueActions
  23. {
  24. StringList addValues;
  25. StringList delValues;
  26. };
  27. typedef map <
  28. String,
  29. ValueActions,
  30. less<String>,
  31. Burnslib::Heap::Allocator<ValueActions>
  32. > PropertyActions;
  33. typedef map <
  34. ObjectId,
  35. PropertyActions,
  36. less<ObjectId>,
  37. Burnslib::Heap::Allocator<PropertyActions>
  38. > ObjectActions;
  39. // The previous map was thought keeping in mind the repair phase.
  40. // It accumulates additions and removals for properties
  41. // in order to provide an ldiff layout where all actions
  42. // related to a property would be grouped under all
  43. // actions related to an object
  44. //
  45. // The repair phase will do something like
  46. // For each element of objectActions
  47. // write the header for the object
  48. // like "dn: CN=object,CN=401,CN=DisplaySpecifiers...\n"
  49. // write "changetype: ntdsSchemaModify\n"
  50. // For each Property in the object
  51. // get the list of actions for the property
  52. // if you have a reset, write "delete: property\n-"
  53. // if you have additions
  54. // write "add: property\n"
  55. // write all additions in the form "property: addValue\n"
  56. // write "\n-\n"
  57. // End if
  58. // if you have removals
  59. // write "delete: property\n"
  60. // write all removals in the form "property: delValue\n"
  61. // write "\n-\n"
  62. // End if
  63. // End For Each
  64. // End For Each
  65. typedef list <
  66. ObjectId,
  67. Burnslib::Heap::Allocator<ObjectId>
  68. > ObjectIdList;
  69. struct SingleValue
  70. {
  71. long locale;
  72. String object;
  73. String property;
  74. String value;
  75. SingleValue
  76. (
  77. const long locale_,
  78. const String &object_,
  79. const String &property_,
  80. const String &value_
  81. )
  82. :
  83. locale(locale_),
  84. object(object_),
  85. property(property_),
  86. value(value_)
  87. {}
  88. };
  89. typedef list <
  90. SingleValue,
  91. Burnslib::Heap::Allocator<SingleValue>
  92. > SingleValueList;
  93. struct AnalisysResults
  94. {
  95. LongList createContainers;
  96. ObjectIdList conflictingXPObjects;
  97. ObjectIdList createXPObjects;
  98. ObjectIdList createW2KObjects;
  99. ObjectActions objectActions;
  100. SingleValueList customizedValues;
  101. ObjectActions extraneousValues;
  102. };
  103. #endif