nx_metadata_sdk 1.0 Metadata SDK

to_string.h
1 // Copyright 2018-present Network Optix, Inc. Licensed under MPL 2.0: www.mozilla.org/MPL/2.0/
2
3 #pragma once
4
5 #include <string>
6 #include <ostream>
7
8 #include <nx/sdk/result.h>
9 #include <nx/sdk/i_string.h>
10 #include <nx/sdk/i_string_map.h>
11 #include <nx/sdk/i_device_info.h>
12
13 namespace nx {
14 namespace sdk {
15
16 std::string toString(const IString* string);
17
27 std::string toString(const IStringMap* map, int overallIndent = 0);
28
38 std::string toJsonString(const IStringMap* map, int overallIndent = 0);
39
41 std::string toJsonString(const IDeviceInfo* deviceInfo, int overallIndent = 0);
42
43 std::string toString(ErrorCode errorCode);
44
45 } // namespace sdk
46 } // namespace nx
47
48 //-------------------------------------------------------------------------------------------------
49 // Functions that need to be in namespace std for compatibility with STL features.
50
51 namespace std {
52
53 inline std::ostream& operator<<(std::ostream& os, nx::sdk::ErrorCode errorCode)
54 {
55 return os << nx::sdk::toString(errorCode);
56 }
57
58 } // namespace std
std
Definition: to_string.h:51
nx
Definition: apple_utils.h:6