BeJsonUtilities.h
Go to the documentation of this file.
1 /*--------------------------------------------------------------------------------------+
2 |
3 | Supplied under applicable software license agreement.
4 |
5 | Copyright (c) 2018 Bentley Systems, Incorporated. All rights reserved.
6 |
7 +---------------------------------------------------------------------------------------*/
8 #pragma once
9 #include <Bentley/Bentley.h>
10 #include <Bentley/DateTime.h>
11 #include <Bentley/WString.h>
13 #include <json/json.h>
14 
16 
17 typedef Json::Value& JsonValueR;
18 typedef Json::Value const& JsonValueCR;
19 
20 //=======================================================================================
21 // @bsiclass Bentley Systems
22 //=======================================================================================
24 {
25 public:
29  static bool HasRequiredMembers(JsonValueCR valueObj, Utf8CP const* requiredMembers);
30 
36  static bool HasOnlyExpectedMembers(JsonValueCR valueObj, Utf8CP const* requiredMembers, Utf8CP const* optionalMembers);
37 
39  static Json::Value StringValueFromInt64(int64_t lld);
40 
44  static uint64_t UInt64FromValue(JsonValueCR value, uint64_t defaultOnError = 0);
45 
49  static int64_t Int64FromValue(JsonValueCR value, int64_t defaultOnError = 0);
50 
54  static DateTime DateTimeFromValue(JsonValueCR value);
55 
62  static bool IsValidObject(Utf8CP objectName, JsonValueCR objectValue, Utf8CP const* requiredMembers, Utf8CP const* optionalMembers);
63 
70  static Utf8CP CStringFromStringValue(JsonValueCR stringValue, Utf8CP defaultCString);
71 };
72 
Definition: BeJsonUtilities.h:23
long long int64_t
Definition: Bentley.r.h:94
Provides Bentley specific date/time functions (Bentley/BeAssert.h).
Json::Value & JsonValueR
Definition: BeJsonUtilities.h:17
Represents an instant in time, typically expressed as a date and time of day.
Definition: DateTime.h:28
#define BEGIN_BENTLEY_NAMESPACE
Definition: Bentley.r.h:24
Declares the NonCopyableClass.
Json::Value const & JsonValueCR
Definition: BeJsonUtilities.h:18
unsigned long long uint64_t
Definition: Bentley.r.h:95
Defines typedefs and constants that can be used across other namespaces. All Bentley-authored C++ sou...
Utf8Char const * Utf8CP
Definition: Bentley.h:229
#define END_BENTLEY_NAMESPACE
Definition: Bentley.r.h:25

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.