Run clang-format.

This commit is contained in:
Jesse Beder
2016-10-12 00:00:39 -05:00
parent 086fec5c35
commit b5b03bb9ad
10 changed files with 35 additions and 43 deletions

View File

@@ -270,7 +270,6 @@ struct convert<std::array<T, N>> {
}
private:
static bool isNodeValid(const Node& node) {
return node.IsSequence() && node.size() == N;
}

View File

@@ -48,9 +48,8 @@ void NodeBuilder::OnScalar(const Mark& mark, const std::string& tag,
Pop();
}
void NodeBuilder::OnSequenceStart(const Mark& mark,
const std::string& tag, anchor_t anchor,
EmitterStyle::value style) {
void NodeBuilder::OnSequenceStart(const Mark& mark, const std::string& tag,
anchor_t anchor, EmitterStyle::value style) {
detail::node& node = Push(mark, anchor);
node.set_tag(tag);
node.set_type(NodeType::Sequence);

View File

@@ -4,6 +4,7 @@ namespace YAML {
_Null Null;
bool IsNullString(const std::string& str) {
return str.empty() || str == "~" || str == "null" || str == "Null" || str == "NULL";
return str.empty() || str == "~" || str == "null" || str == "Null" ||
str == "NULL";
}
}

View File

@@ -22,26 +22,18 @@ class ptr_vector : private YAML::noncopyable {
public:
ptr_vector() {}
void clear() {
m_data.clear();
}
void clear() { m_data.clear(); }
std::size_t size() const { return m_data.size(); }
bool empty() const { return m_data.empty(); }
void push_back(std::unique_ptr<T>&& t) {
m_data.push_back(std::move(t));
}
void push_back(std::unique_ptr<T>&& t) { m_data.push_back(std::move(t)); }
T& operator[](std::size_t i) { return *m_data[i]; }
const T& operator[](std::size_t i) const { return *m_data[i]; }
T& back() {
return *(m_data.back().get());
}
T& back() { return *(m_data.back().get()); }
const T& back() const {
return *(m_data.back().get());
}
const T& back() const { return *(m_data.back().get()); }
private:
std::vector<std::unique_ptr<T>> m_data;

View File

@@ -144,7 +144,8 @@ TEST(NodeTest, IteratorOnConstUndefinedNode) {
Node& nonConstUndefinedNode = const_cast<Node&>(undefinedCn);
std::size_t count = 0;
for (iterator it = nonConstUndefinedNode.begin(); it != nonConstUndefinedNode.end(); ++it) {
for (iterator it = nonConstUndefinedNode.begin();
it != nonConstUndefinedNode.end(); ++it) {
count++;
}
EXPECT_EQ(0, count);
@@ -174,8 +175,8 @@ TEST(NodeTest, StdArrayWrongSize) {
std::array<int, 3> evens{{2, 4, 6}};
Node node;
node["evens"] = evens;
EXPECT_THROW_REPRESENTATION_EXCEPTION((node["evens"].as<std::array<int, 5>>()),
ErrorMsg::BAD_CONVERSION);
EXPECT_THROW_REPRESENTATION_EXCEPTION(
(node["evens"].as<std::array<int, 5>>()), ErrorMsg::BAD_CONVERSION);
}
TEST(NodeTest, StdVector) {