Skip to content

Commit c441880

Browse files
authored
Move constants from _detail namespace into private hpp in src. (#6152)
* Move constants from _detail namespace into private hpp in src. * Address PR feedback, rename file to tables_constants.hpp
1 parent 064fcad commit c441880

File tree

4 files changed

+46
-35
lines changed

4 files changed

+46
-35
lines changed

sdk/tables/azure-data-tables/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,11 @@ set(
7070
src/private/policies/tenant_bearer_token_policy.hpp
7171
src/private/policies/timeout_policy.hpp
7272
src/private/serializers.hpp
73+
src/private/tables_constants.hpp
7374
src/private/url_encode.hpp
7475
src/private/xml_wrapper.hpp
7576
src/serializers.cpp
76-
src/tables_clients.cpp
77+
src/table_clients.cpp
7778
src/tables_sas_builder.cpp
7879
src/xml_wrapper.cpp
7980
)

sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -36,40 +36,6 @@ namespace Azure { namespace Data { namespace Test {
3636
#endif
3737

3838
namespace Azure { namespace Data { namespace Tables {
39-
40-
namespace _detail {
41-
/**
42-
* The package name of the SDK.
43-
*/
44-
constexpr static const char* TablesServicePackageName = "data-tables";
45-
// various strings used in the library
46-
constexpr static const char* OriginHeader = "Origin";
47-
constexpr static const char* AccessControlRequestMethodHeader = "Access-Control-Request-Method";
48-
constexpr static const char* ResrouceTypeService = "service";
49-
constexpr static const char* ComponentProperties = "properties";
50-
constexpr static const char* ContentTypeXml = "application/xml";
51-
constexpr static const char* ContentTypeJson = "application/json";
52-
constexpr static const char* ResourceTypeHeader = "restype";
53-
constexpr static const char* CompHeader = "comp";
54-
constexpr static const char* ContentTypeHeader = "Content-Type";
55-
constexpr static const char* ContentLengthHeader = "Content-Length";
56-
constexpr static const char* AcceptHeader = "Accept";
57-
constexpr static const char* PreferHeader = "Prefer";
58-
constexpr static const char* PreferNoContent = "return-no-content";
59-
constexpr static const char* AcceptFullMeta = "application/json;odata=fullmetadata";
60-
constexpr static const char* IfMatch = "If-Match";
61-
constexpr static const char* PartitionKeyFragment = "(PartitionKey='";
62-
constexpr static const char* RowKeyFragment = "',RowKey='";
63-
constexpr static const char* ClosingFragment = "')";
64-
constexpr static const char* Value = "value";
65-
constexpr static const char* TableName = "TableName";
66-
constexpr static const char* ODataEditLink = "odata.editLink";
67-
constexpr static const char* ODataId = "odata.id";
68-
constexpr static const char* ODataType = "odata.type";
69-
constexpr static const char* ODataMeta = "odata.metadata";
70-
constexpr static const char* ODataError = "odata.error";
71-
} // namespace _detail
72-
7339
/**
7440
* @brief Optional parameters for constructing a new TableClient.
7541
*/
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
/**
5+
* @file
6+
* @brief Centralize the string constants used by Table Clients.
7+
*
8+
*/
9+
10+
#pragma once
11+
12+
namespace Azure { namespace Data { namespace Tables { namespace _detail {
13+
/**
14+
* The package name of the SDK.
15+
*/
16+
constexpr static const char* TablesServicePackageName = "data-tables";
17+
// various strings used in the library
18+
constexpr static const char* OriginHeader = "Origin";
19+
constexpr static const char* AccessControlRequestMethodHeader = "Access-Control-Request-Method";
20+
constexpr static const char* ResrouceTypeService = "service";
21+
constexpr static const char* ComponentProperties = "properties";
22+
constexpr static const char* ContentTypeXml = "application/xml";
23+
constexpr static const char* ContentTypeJson = "application/json";
24+
constexpr static const char* ResourceTypeHeader = "restype";
25+
constexpr static const char* CompHeader = "comp";
26+
constexpr static const char* ContentTypeHeader = "Content-Type";
27+
constexpr static const char* ContentLengthHeader = "Content-Length";
28+
constexpr static const char* AcceptHeader = "Accept";
29+
constexpr static const char* PreferHeader = "Prefer";
30+
constexpr static const char* PreferNoContent = "return-no-content";
31+
constexpr static const char* AcceptFullMeta = "application/json;odata=fullmetadata";
32+
constexpr static const char* IfMatch = "If-Match";
33+
constexpr static const char* PartitionKeyFragment = "(PartitionKey='";
34+
constexpr static const char* RowKeyFragment = "',RowKey='";
35+
constexpr static const char* ClosingFragment = "')";
36+
constexpr static const char* Value = "value";
37+
constexpr static const char* TableName = "TableName";
38+
constexpr static const char* ODataEditLink = "odata.editLink";
39+
constexpr static const char* ODataId = "odata.id";
40+
constexpr static const char* ODataType = "odata.type";
41+
constexpr static const char* ODataMeta = "odata.metadata";
42+
constexpr static const char* ODataError = "odata.error";
43+
}}}} // namespace Azure::Data::Tables::_detail

sdk/tables/azure-data-tables/src/tables_clients.cpp renamed to sdk/tables/azure-data-tables/src/table_clients.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include "private/policies/tenant_bearer_token_policy.hpp"
1010
#include "private/policies/timeout_policy.hpp"
1111
#include "private/serializers.hpp"
12+
#include "private/tables_constants.hpp"
1213

1314
#include <sstream>
1415
#include <string>

0 commit comments

Comments
 (0)