File tree Expand file tree Collapse file tree 16 files changed +32
-32
lines changed
Expand file tree Collapse file tree 16 files changed +32
-32
lines changed Original file line number Diff line number Diff line change 11# http://clang.llvm.org/docs/ClangFormatStyleOptions.html
22
33BasedOnStyle : Google
4- Standard : Cpp03
4+ Standard : c++11
55AllowShortFunctionsOnASingleLine : Empty
66IncludeBlocks : Preserve
77IndentPPDirectives : AfterHash
Original file line number Diff line number Diff line change 1212
1313namespace ArduinoJson {
1414template <typename T>
15- struct Converter <std::vector<T> > {
15+ struct Converter <std::vector<T>> {
1616 static void toJson (const std::vector<T>& src, JsonVariant dst) {
1717 JsonArray array = dst.to <JsonArray>();
1818 for (T item : src)
@@ -36,7 +36,7 @@ struct Converter<std::vector<T> > {
3636};
3737
3838template <typename T, size_t N>
39- struct Converter <std::array<T, N> > {
39+ struct Converter <std::array<T, N>> {
4040 static void toJson (const std::array<T, N>& src, JsonVariant dst) {
4141 JsonArray array = dst.to <JsonArray>();
4242 for (T item : src)
@@ -79,22 +79,22 @@ TEST_CASE("vector<int>") {
7979 doc.add (1 );
8080 doc.add (2 );
8181
82- auto v = doc.as <std::vector<int > >();
82+ auto v = doc.as <std::vector<int >>();
8383 REQUIRE (v.size () == 2 );
8484 CHECK (v[0 ] == 1 );
8585 CHECK (v[1 ] == 2 );
8686 }
8787
8888 SECTION (" checkJson" ) {
8989 StaticJsonDocument<128 > doc;
90- CHECK (doc.is <std::vector<int > >() == false );
90+ CHECK (doc.is <std::vector<int >>() == false );
9191
9292 doc.add (1 );
9393 doc.add (2 );
94- CHECK (doc.is <std::vector<int > >() == true );
94+ CHECK (doc.is <std::vector<int >>() == true );
9595
9696 doc.add (" foo" );
97- CHECK (doc.is <std::vector<int > >() == false );
97+ CHECK (doc.is <std::vector<int >>() == false );
9898 }
9999}
100100
Original file line number Diff line number Diff line change @@ -91,13 +91,13 @@ struct EmptyStruct {};
9191
9292TEST_CASE (" IsString<T>" ) {
9393 CHECK (IsString<std::string>::value == true );
94- CHECK (IsString<std::basic_string<wchar_t > >::value == false );
94+ CHECK (IsString<std::basic_string<wchar_t >>::value == false );
9595 CHECK (IsString<custom_string>::value == true );
9696 CHECK (IsString<const __FlashStringHelper*>::value == true );
9797 CHECK (IsString<const char *>::value == true );
9898 CHECK (IsString<const char [8 ]>::value == true );
99- CHECK (IsString< ::String>::value == true );
100- CHECK (IsString< ::StringSumHelper>::value == true );
99+ CHECK (IsString<::String>::value == true );
100+ CHECK (IsString<::StringSumHelper>::value == true );
101101 CHECK (IsString<const EmptyStruct*>::value == false );
102102}
103103
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ TEST_CASE("Writer<std::string>") {
6565
6666TEST_CASE (" Writer<String>" ) {
6767 ::String output;
68- Writer< ::String> writer (output);
68+ Writer<::String> writer (output);
6969
7070 SECTION (" write(char)" ) {
7171 SECTION (" writes to temporary buffer" ) {
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ template <typename TFloat>
1717void check (TFloat input, const std::string& expected) {
1818 std::string output;
1919 Writer<std::string> sb (output);
20- TextFormatter<Writer<std::string> > writer (sb);
20+ TextFormatter<Writer<std::string>> writer (sb);
2121 writer.writeFloat (input);
2222 REQUIRE (writer.bytesWritten () == output.size ());
2323 CHECK (expected == output);
Original file line number Diff line number Diff line change @@ -11,8 +11,8 @@ ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1111// A proxy class to get or set an element of an array.
1212// https://arduinojson.org/v6/api/jsonarray/subscript/
1313template <typename TUpstream>
14- class ElementProxy : public VariantRefBase <ElementProxy<TUpstream> >,
15- public VariantOperators<ElementProxy<TUpstream> > {
14+ class ElementProxy : public VariantRefBase <ElementProxy<TUpstream>>,
15+ public VariantOperators<ElementProxy<TUpstream>> {
1616 friend class VariantAttorney ;
1717
1818 public:
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE
1010
1111template <typename TSource>
1212struct Reader <TSource,
13- typename enable_if<is_base_of< ::String, TSource>::value>::type>
13+ typename enable_if<is_base_of<::String, TSource>::value>::type>
1414 : BoundedReader<const char *> {
1515 explicit Reader (const ::String& s)
1616 : BoundedReader<const char*>(s.c_str(), s.length()) {}
Original file line number Diff line number Diff line change @@ -173,7 +173,7 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
173173 template <typename TString>
174174 FORCE_INLINE typename detail::enable_if<
175175 detail::IsString<TString>::value,
176- detail::MemberProxy<JsonDocument&, TString> >::type
176+ detail::MemberProxy<JsonDocument&, TString>>::type
177177 operator [](const TString& key) {
178178 return {*this , key};
179179 }
@@ -183,7 +183,7 @@ class JsonDocument : public detail::VariantOperators<const JsonDocument&> {
183183 template <typename TChar>
184184 FORCE_INLINE typename detail::enable_if<
185185 detail::IsString<TChar*>::value,
186- detail::MemberProxy<JsonDocument&, TChar*> >::type
186+ detail::MemberProxy<JsonDocument&, TChar*>>::type
187187 operator [](TChar* key) {
188188 return {*this , key};
189189 }
Original file line number Diff line number Diff line change @@ -108,10 +108,10 @@ class JsonObject : public detail::VariantOperators<JsonObject> {
108108 // Gets or sets the member with specified key.
109109 // https://arduinojson.org/v6/api/jsonobject/subscript/
110110 template <typename TString>
111- FORCE_INLINE typename detail::enable_if<
112- detail::IsString<TString>::value,
113- detail::MemberProxy<JsonObject, TString> >::type
114- operator [](const TString& key) const {
111+ FORCE_INLINE
112+ typename detail::enable_if< detail::IsString<TString>::value,
113+ detail::MemberProxy<JsonObject, TString>>::type
114+ operator [](const TString& key) const {
115115 return {*this , key};
116116 }
117117
@@ -120,7 +120,7 @@ class JsonObject : public detail::VariantOperators<JsonObject> {
120120 template <typename TChar>
121121 FORCE_INLINE
122122 typename detail::enable_if<detail::IsString<TChar*>::value,
123- detail::MemberProxy<JsonObject, TChar*> >::type
123+ detail::MemberProxy<JsonObject, TChar*>>::type
124124 operator [](TChar* key) const {
125125 return {*this , key};
126126 }
Original file line number Diff line number Diff line change @@ -69,15 +69,15 @@ VariantRefBase<TDerived>::containsKey(TChar* key) const {
6969template <typename TDerived>
7070template <typename TString>
7171inline typename enable_if<IsString<TString*>::value,
72- MemberProxy<TDerived, TString*> >::type
72+ MemberProxy<TDerived, TString*>>::type
7373VariantRefBase<TDerived>::operator [](TString* key) const {
7474 return MemberProxy<TDerived, TString*>(derived (), key);
7575}
7676
7777template <typename TDerived>
7878template <typename TString>
7979inline typename enable_if<IsString<TString>::value,
80- MemberProxy<TDerived, TString> >::type
80+ MemberProxy<TDerived, TString>>::type
8181VariantRefBase<TDerived>::operator [](const TString& key) const {
8282 return MemberProxy<TDerived, TString>(derived (), key);
8383}
You can’t perform that action at this time.
0 commit comments