Skip to content

Commit 59bbbdb

Browse files
committed
heap namespace
1 parent f3eb4f2 commit 59bbbdb

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

include/jsoncons/basic_json.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ namespace jsoncons {
613613
// long_string_storage
614614
struct long_string_storage
615615
{
616-
using heap_string_factory_type = jsoncons::heap_string_factory<char_type,null_type,Allocator>;
616+
using heap_string_factory_type = jsoncons::heap::heap_string_factory<char_type,null_type,Allocator>;
617617
using pointer = typename heap_string_factory_type::pointer;
618618

619619
uint8_t storage_kind_:4;
@@ -662,7 +662,7 @@ namespace jsoncons {
662662
// byte_string_storage
663663
struct byte_string_storage
664664
{
665-
using heap_string_factory_type = jsoncons::heap_string_factory<uint8_t,uint64_t,Allocator>;
665+
using heap_string_factory_type = jsoncons::heap::heap_string_factory<uint8_t,uint64_t,Allocator>;
666666
using pointer = typename heap_string_factory_type::pointer;
667667

668668
uint8_t storage_kind_:4;
@@ -927,14 +927,14 @@ namespace jsoncons {
927927

928928
typename long_string_storage::pointer create_long_string(const allocator_type& alloc, const char_type* data, std::size_t length)
929929
{
930-
using heap_string_factory_type = jsoncons::heap_string_factory<char_type,null_type,Allocator>;
930+
using heap_string_factory_type = jsoncons::heap::heap_string_factory<char_type,null_type,Allocator>;
931931
return heap_string_factory_type::create(data, length, null_type(), alloc);
932932
}
933933

934934
typename byte_string_storage::pointer create_byte_string(const allocator_type& alloc, const uint8_t* data, std::size_t length,
935935
uint64_t ext_tag)
936936
{
937-
using heap_string_factory_type = jsoncons::heap_string_factory<uint8_t,uint64_t,Allocator>;
937+
using heap_string_factory_type = jsoncons::heap::heap_string_factory<uint8_t,uint64_t,Allocator>;
938938
return heap_string_factory_type::create(data, length, ext_tag, alloc);
939939
}
940940

include/jsoncons/utility/heap_string.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <jsoncons/utility/more_type_traits.hpp>
1717

1818
namespace jsoncons {
19+
namespace heap {
1920

2021
inline char*
2122
align_up(char* ptr, std::size_t alignment) noexcept
@@ -181,6 +182,7 @@ class heap_string_factory
181182
}
182183
};
183184

185+
} // namespace heap
184186
} // namespace jsoncons
185187

186188
#endif // JSONCONS_UTILITY_HEAP_STRING_HPP

test/corelib/src/utility/heap_string_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ using namespace jsoncons;
1515

1616
TEST_CASE("heap_string test")
1717
{
18-
using heap_string_factory_type = jsoncons::heap_string_factory<char, null_type, std::allocator<char>>;
18+
using heap_string_factory_type = jsoncons::heap::heap_string_factory<char, null_type, std::allocator<char>>;
1919
using pointer = typename heap_string_factory_type::pointer;
2020

2121
std::string s("Hello World");
@@ -63,7 +63,7 @@ class checked_resource : public std::pmr::memory_resource
6363

6464
TEST_CASE("heap_string with polymorphic allocator test")
6565
{
66-
using heap_string_factory_type = jsoncons::heap_string_factory<char, null_type, std::pmr::polymorphic_allocator<char>>;
66+
using heap_string_factory_type = jsoncons::heap::heap_string_factory<char, null_type, std::pmr::polymorphic_allocator<char>>;
6767
using pointer = typename heap_string_factory_type::pointer;
6868

6969
char buffer[1024] = {}; // a small buffer on the stack

0 commit comments

Comments
 (0)