Added newline at ed of file

This commit is contained in:
Benoit Blanchon
2014-10-23 23:45:36 +02:00
parent e85f27c0f3
commit 55b0eab3e6
39 changed files with 44 additions and 39 deletions

View File

@ -27,4 +27,4 @@ class CompactJsonWriter : public JsonWriter {
virtual void endObject() { _length += _sink->write('}'); } virtual void endObject() { _length += _sink->write('}'); }
}; };
} }
} }

View File

@ -161,4 +161,4 @@ class JsonNode {
} }
}; };
} }
} }

View File

@ -38,4 +38,4 @@ class JsonParser {
inline JsonNode *parseString(); inline JsonNode *parseString();
}; };
} }
} }

View File

@ -57,4 +57,4 @@ class PrettyJsonWriter : public JsonWriter {
} }
}; };
} }
} }

View File

@ -17,4 +17,4 @@ class QuotedString {
static char *extractFrom(char *input, char **end); static char *extractFrom(char *input, char **end);
}; };
} }
} }

View File

@ -25,4 +25,4 @@ class StringBuilder : public Print {
int length; int length;
}; };
} }
} }

View File

@ -32,4 +32,4 @@ class JsonArrayIterator {
private: private:
Internals::JsonNode *_node; Internals::JsonNode *_node;
}; };
} }

View File

@ -47,4 +47,4 @@ class JsonBuffer {
Internals::JsonNode *value); Internals::JsonNode *value);
Internals::JsonNode *createStringNode(const char *value); Internals::JsonNode *createStringNode(const char *value);
}; };
} }

View File

@ -49,4 +49,4 @@ class JsonContainer : public Printable, public Internals::JsonNodeWrapper {
void removeChild(Internals::JsonNode *); void removeChild(Internals::JsonNode *);
Internals::JsonNode *createNode(); Internals::JsonNode *createNode();
}; };
} }

View File

@ -31,4 +31,4 @@ class JsonObject : public JsonContainer {
private: private:
Internals::JsonNode *getOrCreateNodeAt(const char *key); Internals::JsonNode *getOrCreateNodeAt(const char *key);
}; };
} }

View File

@ -38,4 +38,4 @@ class JsonObjectIterator {
private: private:
JsonObjectKeyValue _objectKeyValue; JsonObjectKeyValue _objectKeyValue;
}; };
} }

View File

@ -30,4 +30,4 @@ class JsonObjectKeyValue {
private: private:
Internals::JsonNode *_node; Internals::JsonNode *_node;
}; };
} }

View File

@ -43,4 +43,4 @@ class JsonValue : public Internals::JsonNodeWrapper {
return static_cast<T>(*this); return static_cast<T>(*this);
} }
}; };
} }

View File

@ -1,2 +1,7 @@
cd .. cd ..
find include src test -regex ".*\.[ch]pp$" -exec clang-format -style=Google -i {} \; FILES=$(find include src test -regex ".*\.[ch]pp$")
clang-format -style=Google -i $FILES
# insert newline at end of file
sed -i -e '$a\' $FILES

View File

@ -31,4 +31,4 @@ size_t Print::print(long value) {
size_t Print::println() { return write('\r') + write('\n'); } size_t Print::println() { return write('\r') + write('\n'); }
#endif #endif

View File

@ -38,4 +38,4 @@ inline size_t IndentedPrint::writeTabs() {
for (int i = 0; i < level * tabSize; i++) n += sink->write(' '); for (int i = 0; i < level * tabSize; i++) n += sink->write(' ');
return n; return n;
} }

View File

@ -21,4 +21,4 @@ void JsonWriter::writeBoolean(bool value) {
void JsonWriter::writeDouble(double value, int decimals) { void JsonWriter::writeDouble(double value, int decimals) {
_length += _sink->print(value, decimals); _length += _sink->print(value, decimals);
} }

View File

@ -96,4 +96,4 @@ char *QuotedString::extractFrom(char *input, char **endPtr) {
*endPtr = readPtr; *endPtr = readPtr;
return startPtr; return startPtr;
} }

View File

@ -14,4 +14,4 @@ size_t StringBuilder::write(uint8_t c) {
buffer[length++] = c; buffer[length++] = c;
buffer[length] = 0; buffer[length] = 0;
return 1; return 1;
} }

View File

@ -87,4 +87,4 @@ JsonArrayIterator JsonArray::begin() {
if (!_node) return end(); if (!_node) return end();
return JsonArrayIterator(_node->getContainerChild()); return JsonArrayIterator(_node->getContainerChild());
} }

View File

@ -94,4 +94,4 @@ JsonNode *JsonBuffer::createStringNode(const char *value) {
if (node) node->setAsString(value); if (node) node->setAsString(value);
return node; return node;
} }

View File

@ -69,4 +69,4 @@ JsonNode *JsonObject::getOrCreateNodeAt(const char *key) {
JsonObjectIterator JsonObject::begin() { JsonObjectIterator JsonObject::begin() {
return JsonObjectIterator(_node->getContainerChild()); return JsonObjectIterator(_node->getContainerChild());
} }

View File

@ -42,4 +42,4 @@ JsonValue::operator long() const { return _node ? _node->getAsInteger() : 0; }
JsonValue::operator JsonArray() const { return JsonArray(_node); } JsonValue::operator JsonArray() const { return JsonArray(_node); }
JsonValue::operator JsonObject() const { return JsonObject(_node); } JsonValue::operator JsonObject() const { return JsonObject(_node); }

View File

@ -132,4 +132,4 @@ TEST_F(JsonArray_Container_Tests, CanCreateNestedObjects) {
firstElementMustBe(innerObject1); firstElementMustBe(innerObject1);
secondElementMustBe(innerObject2); secondElementMustBe(innerObject2);
nodeCountMustBe(3); nodeCountMustBe(3);
} }

View File

@ -27,4 +27,4 @@ TEST(JsonArray_Iterator_Test, SimpleTest) {
EXPECT_EQ(34, (*it).as<int>()); // TODO: use -> EXPECT_EQ(34, (*it).as<int>()); // TODO: use ->
++it; ++it;
EXPECT_EQ(array.end(), it); EXPECT_EQ(array.end(), it);
} }

View File

@ -80,4 +80,4 @@ TEST_F(JsonArray_PrettyPrintTo_Tests, NestedArrays) {
" \"key\": 3\r\n" " \"key\": 3\r\n"
" }\r\n" " }\r\n"
"]"); "]");
} }

View File

@ -125,4 +125,4 @@ TEST_F(JsonArray_PrintTo_Tests, OneEmptyNestedHash) {
array.createNestedObject(); array.createNestedObject();
outputMustBe("[{}]"); outputMustBe("[{}]");
} }

View File

@ -111,4 +111,4 @@ TEST_F(JsonObject_Container_Tests, CanStoreInnerObjects) {
EXPECT_EQ(innerObject1, (JsonObject)object["hello"]); EXPECT_EQ(innerObject1, (JsonObject)object["hello"]);
EXPECT_EQ(innerObject2, (JsonObject)object["world"]); EXPECT_EQ(innerObject2, (JsonObject)object["world"]);
} }

View File

@ -29,4 +29,4 @@ TEST(JsonObject_Iterator_Test, SimpleTest) {
EXPECT_EQ(34, it->value().as<int>()); EXPECT_EQ(34, it->value().as<int>());
++it; ++it;
EXPECT_EQ(object.end(), it); EXPECT_EQ(object.end(), it);
} }

View File

@ -77,4 +77,4 @@ TEST_F(JsonObject_PrettyPrintTo_Tests, NestedContainers) {
" 2\r\n" " 2\r\n"
" ]\r\n" " ]\r\n"
"}"); "}");
} }

View File

@ -138,4 +138,4 @@ TEST_F(JsonObject_Serialization_Tests, OneEmptyNestedArray) {
object.createNestedArray("key"); object.createNestedArray("key");
outputMustBe("{\"key\":[]}"); outputMustBe("{\"key\":[]}");
} }

View File

@ -145,4 +145,4 @@ TEST_F(JsonParser_Array_Tests, TwoStrings) {
sizeMustBe(2); sizeMustBe(2);
firstElementMustBe("hello"); firstElementMustBe("hello");
secondElementMustBe("world"); secondElementMustBe("world");
} }

View File

@ -53,4 +53,4 @@ TEST(JsonParser_Nested_Tests, ObjectNestedInArray) {
EXPECT_EQ(2, object1["b"].as<int>()); EXPECT_EQ(2, object1["b"].as<int>());
EXPECT_EQ(3, object2["c"].as<int>()); EXPECT_EQ(3, object2["c"].as<int>());
EXPECT_EQ(4, object2["d"].as<int>()); EXPECT_EQ(4, object2["d"].as<int>());
} }

View File

@ -171,4 +171,4 @@ TEST_F(JsonParser_Object_Test, TwoNulls) {
TEST_F(JsonParser_Object_Test, NullForKey) { TEST_F(JsonParser_Object_Test, NullForKey) {
whenInputIs("null:\"value\"}"); whenInputIs("null:\"value\"}");
parseMustFail(); parseMustFail();
} }

View File

@ -108,4 +108,4 @@ TEST_F(JsonValueTests, ArraysAreCopiedByReference) {
array.add("world"); array.add("world");
EXPECT_EQ(1, ((JsonObject)jsonValue1).size()); EXPECT_EQ(1, ((JsonObject)jsonValue1).size());
} }

View File

@ -127,4 +127,4 @@ TEST_F(QuotedString_ExtractFrom_Tests, EscapedTab) {
TEST_F(QuotedString_ExtractFrom_Tests, AllEscapedCharsTogether) { TEST_F(QuotedString_ExtractFrom_Tests, AllEscapedCharsTogether) {
whenInputIs("\"1\\\"2\\\\3\\/4\\b5\\f6\\n7\\r8\\t9\""); whenInputIs("\"1\\\"2\\\\3\\/4\\b5\\f6\\n7\\r8\\t9\"");
resultMustBe("1\"2\\3/4\b5\f6\n7\r8\t9"); resultMustBe("1\"2\\3/4\b5\f6\n7\r8\t9");
} }

View File

@ -76,4 +76,4 @@ TEST_F(QuotedString_PrintTo_Tests, CarriageReturn) {
TEST_F(QuotedString_PrintTo_Tests, HorizontalTab) { TEST_F(QuotedString_PrintTo_Tests, HorizontalTab) {
whenInputIs("\t"); whenInputIs("\t");
outputMustBe("\"\\t\""); outputMustBe("\"\\t\"");
} }

View File

@ -72,4 +72,4 @@ TEST(
obj["hello"]; obj["hello"];
EXPECT_EQ(3, json.size()); EXPECT_EQ(3, json.size());
} }

View File

@ -57,4 +57,4 @@ TEST_F(StringBuilderTests, TwoStrings) {
resultMustBe(4); resultMustBe(4);
outputMustBe("ABCDEFGH"); outputMustBe("ABCDEFGH");
} }