diff --git a/sdk/tables/azure-data-tables/CMakeLists.txt b/sdk/tables/azure-data-tables/CMakeLists.txt index 9ac8e4607..76d02ace0 100644 --- a/sdk/tables/azure-data-tables/CMakeLists.txt +++ b/sdk/tables/azure-data-tables/CMakeLists.txt @@ -70,10 +70,11 @@ set( src/private/policies/tenant_bearer_token_policy.hpp src/private/policies/timeout_policy.hpp src/private/serializers.hpp + src/private/tables_constants.hpp src/private/url_encode.hpp src/private/xml_wrapper.hpp src/serializers.cpp - src/tables_clients.cpp + src/table_clients.cpp src/tables_sas_builder.cpp src/xml_wrapper.cpp ) diff --git a/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp b/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp index d8c61aa99..4b6830c43 100644 --- a/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp +++ b/sdk/tables/azure-data-tables/inc/azure/data/tables/table_client.hpp @@ -36,40 +36,6 @@ namespace Azure { namespace Data { namespace Test { #endif namespace Azure { namespace Data { namespace Tables { - - namespace _detail { - /** - * The package name of the SDK. - */ - constexpr static const char* TablesServicePackageName = "data-tables"; - // various strings used in the library - constexpr static const char* OriginHeader = "Origin"; - constexpr static const char* AccessControlRequestMethodHeader = "Access-Control-Request-Method"; - constexpr static const char* ResrouceTypeService = "service"; - constexpr static const char* ComponentProperties = "properties"; - constexpr static const char* ContentTypeXml = "application/xml"; - constexpr static const char* ContentTypeJson = "application/json"; - constexpr static const char* ResourceTypeHeader = "restype"; - constexpr static const char* CompHeader = "comp"; - constexpr static const char* ContentTypeHeader = "Content-Type"; - constexpr static const char* ContentLengthHeader = "Content-Length"; - constexpr static const char* AcceptHeader = "Accept"; - constexpr static const char* PreferHeader = "Prefer"; - constexpr static const char* PreferNoContent = "return-no-content"; - constexpr static const char* AcceptFullMeta = "application/json;odata=fullmetadata"; - constexpr static const char* IfMatch = "If-Match"; - constexpr static const char* PartitionKeyFragment = "(PartitionKey='"; - constexpr static const char* RowKeyFragment = "',RowKey='"; - constexpr static const char* ClosingFragment = "')"; - constexpr static const char* Value = "value"; - constexpr static const char* TableName = "TableName"; - constexpr static const char* ODataEditLink = "odata.editLink"; - constexpr static const char* ODataId = "odata.id"; - constexpr static const char* ODataType = "odata.type"; - constexpr static const char* ODataMeta = "odata.metadata"; - constexpr static const char* ODataError = "odata.error"; - } // namespace _detail - /** * @brief Optional parameters for constructing a new TableClient. */ diff --git a/sdk/tables/azure-data-tables/src/private/tables_constants.hpp b/sdk/tables/azure-data-tables/src/private/tables_constants.hpp new file mode 100644 index 000000000..8dbdc73b8 --- /dev/null +++ b/sdk/tables/azure-data-tables/src/private/tables_constants.hpp @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +/** + * @file + * @brief Centralize the string constants used by Table Clients. + * + */ + +#pragma once + +namespace Azure { namespace Data { namespace Tables { namespace _detail { + /** + * The package name of the SDK. + */ + constexpr static const char* TablesServicePackageName = "data-tables"; + // various strings used in the library + constexpr static const char* OriginHeader = "Origin"; + constexpr static const char* AccessControlRequestMethodHeader = "Access-Control-Request-Method"; + constexpr static const char* ResrouceTypeService = "service"; + constexpr static const char* ComponentProperties = "properties"; + constexpr static const char* ContentTypeXml = "application/xml"; + constexpr static const char* ContentTypeJson = "application/json"; + constexpr static const char* ResourceTypeHeader = "restype"; + constexpr static const char* CompHeader = "comp"; + constexpr static const char* ContentTypeHeader = "Content-Type"; + constexpr static const char* ContentLengthHeader = "Content-Length"; + constexpr static const char* AcceptHeader = "Accept"; + constexpr static const char* PreferHeader = "Prefer"; + constexpr static const char* PreferNoContent = "return-no-content"; + constexpr static const char* AcceptFullMeta = "application/json;odata=fullmetadata"; + constexpr static const char* IfMatch = "If-Match"; + constexpr static const char* PartitionKeyFragment = "(PartitionKey='"; + constexpr static const char* RowKeyFragment = "',RowKey='"; + constexpr static const char* ClosingFragment = "')"; + constexpr static const char* Value = "value"; + constexpr static const char* TableName = "TableName"; + constexpr static const char* ODataEditLink = "odata.editLink"; + constexpr static const char* ODataId = "odata.id"; + constexpr static const char* ODataType = "odata.type"; + constexpr static const char* ODataMeta = "odata.metadata"; + constexpr static const char* ODataError = "odata.error"; +}}}} // namespace Azure::Data::Tables::_detail diff --git a/sdk/tables/azure-data-tables/src/tables_clients.cpp b/sdk/tables/azure-data-tables/src/table_clients.cpp similarity index 99% rename from sdk/tables/azure-data-tables/src/tables_clients.cpp rename to sdk/tables/azure-data-tables/src/table_clients.cpp index 34677e8ac..7cde3655e 100644 --- a/sdk/tables/azure-data-tables/src/tables_clients.cpp +++ b/sdk/tables/azure-data-tables/src/table_clients.cpp @@ -9,6 +9,7 @@ #include "private/policies/tenant_bearer_token_policy.hpp" #include "private/policies/timeout_policy.hpp" #include "private/serializers.hpp" +#include "private/tables_constants.hpp" #include #include