constants.hpp 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. // Copyright (c) 2014-2021 Thomas Fussell
  2. //
  3. // Permission is hereby granted, free of charge, to any person obtaining a copy
  4. // of this software and associated documentation files (the "Software"), to deal
  5. // in the Software without restriction, including without limitation the rights
  6. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7. // copies of the Software, and to permit persons to whom the Software is
  8. // furnished to do so, subject to the following conditions:
  9. //
  10. // The above copyright notice and this permission notice shall be included in
  11. // all copies or substantial portions of the Software.
  12. //
  13. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19. // THE SOFTWARE
  20. //
  21. // @license: http://www.opensource.org/licenses/mit-license.php
  22. // @author: see AUTHORS file
  23. #pragma once
  24. #include <string>
  25. #include <unordered_map>
  26. #include <xlnt/xlnt_config.hpp>
  27. #include <xlnt/cell/index_types.hpp>
  28. #include <xlnt/utils/path.hpp>
  29. namespace xlnt {
  30. struct XLNT_API constants
  31. {
  32. /// <summary>
  33. /// Returns the lowest allowable row index in a worksheet.
  34. /// </summary>
  35. static row_t min_row();
  36. /// <summary>
  37. /// Returns the largest allowable row index in a worksheet.
  38. /// </summary>
  39. static row_t max_row();
  40. /// <summary>
  41. /// Returns the lowest allowable column index in a worksheet.
  42. /// </summary>
  43. static const column_t min_column();
  44. /// <summary>
  45. /// Returns the largest allowable column index in a worksheet.
  46. /// </summary>
  47. static const column_t max_column();
  48. /// <summary>
  49. /// Returns the URI of the directory containing package properties.
  50. /// </summary>
  51. static const path package_properties();
  52. /// <summary>
  53. /// Returns the URI of the directory containing SpreatsheetML package parts.
  54. /// </summary>
  55. static const path package_xl();
  56. /// <summary>
  57. /// Returns the URI of the directory containing root relationships package part.
  58. /// </summary>
  59. static const path package_root_rels();
  60. /// <summary>
  61. /// Returns the URI of the directory containing package themes.
  62. /// </summary>
  63. static const path package_theme();
  64. /// <summary>
  65. /// Returns the URI of the directory containing package worksheets.
  66. /// </summary>
  67. static const path package_worksheets();
  68. /// <summary>
  69. /// Returns the URI of the directory containing package worksheets.
  70. /// </summary>
  71. static const path package_drawings();
  72. /// <summary>
  73. /// Returns the URI of the content types package part.
  74. /// </summary>
  75. static const path part_content_types();
  76. /// <summary>
  77. /// Returns the URI of the core properties package part.
  78. /// </summary>
  79. static const path part_core();
  80. /// <summary>
  81. /// Returns the URI of the app properties package part.
  82. /// </summary>
  83. static const path part_app();
  84. /// <summary>
  85. /// Returns the URI of the workbook package part.
  86. /// </summary>
  87. static const path part_workbook();
  88. /// <summary>
  89. /// Returns the URI of the root relationships package part.
  90. /// </summary>
  91. static const path part_root_relationships();
  92. /// <summary>
  93. /// Returns the URI of the styles package part.
  94. /// </summary>
  95. static const path part_styles();
  96. /// <summary>
  97. /// Returns the URI of the theme package part.
  98. /// </summary>
  99. static const path part_theme();
  100. /// <summary>
  101. /// Returns the URI of the shared strings package part.
  102. /// </summary>
  103. static const path part_shared_strings();
  104. /// <summary>
  105. /// Returns an unordered_map mapping namespace names to namespaces.
  106. /// </summary>
  107. static const std::unordered_map<std::string, std::string> &namespaces();
  108. /// <summary>
  109. /// Returns the namespace URI from a namespace name.
  110. /// </summary>
  111. static const std::string &ns(const std::string &id);
  112. };
  113. } // namespace xlnt