diff --git a/include/yaml-cpp/binary.h b/include/yaml-cpp/binary.h index 7b536c8..0267a3a 100644 --- a/include/yaml-cpp/binary.h +++ b/include/yaml-cpp/binary.h @@ -22,10 +22,10 @@ class YAML_CPP_API Binary { Binary(const unsigned char *data_, std::size_t size_) : m_data{}, m_unownedData(data_), m_unownedSize(size_) {} Binary() : Binary(nullptr, 0) {} - Binary(const Binary&) = default; - Binary(Binary&&) = default; - Binary& operator=(const Binary&) = default; - Binary& operator=(Binary&&) = default; + Binary(const Binary &) = default; + Binary(Binary &&) = default; + Binary &operator=(const Binary &) = default; + Binary &operator=(Binary &&) = default; bool owned() const { return !m_unownedData; } std::size_t size() const { return owned() ? m_data.size() : m_unownedSize; } @@ -66,6 +66,6 @@ class YAML_CPP_API Binary { const unsigned char *m_unownedData; std::size_t m_unownedSize; }; -} +} // namespace YAML #endif // BASE64_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/contrib/anchordict.h b/include/yaml-cpp/contrib/anchordict.h index 1d7dbc4..1b7809b 100644 --- a/include/yaml-cpp/contrib/anchordict.h +++ b/include/yaml-cpp/contrib/anchordict.h @@ -35,6 +35,6 @@ class AnchorDict { private: std::vector m_data; }; -} +} // namespace YAML #endif // ANCHORDICT_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/emitter.h b/include/yaml-cpp/emitter.h index 90ce2a6..37de878 100644 --- a/include/yaml-cpp/emitter.h +++ b/include/yaml-cpp/emitter.h @@ -250,6 +250,6 @@ inline Emitter& operator<<(Emitter& emitter, _Indent indent) { inline Emitter& operator<<(Emitter& emitter, _Precision precision) { return emitter.SetLocalPrecision(precision); } -} +} // namespace YAML #endif // EMITTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/node/detail/memory.h b/include/yaml-cpp/node/detail/memory.h index 1f5676d..a4df0f7 100644 --- a/include/yaml-cpp/node/detail/memory.h +++ b/include/yaml-cpp/node/detail/memory.h @@ -41,7 +41,7 @@ class YAML_CPP_API memory_holder { private: shared_memory m_pMemory; }; -} -} +} // namespace detail +} // namespace YAML #endif // VALUE_DETAIL_MEMORY_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/node/detail/node.h b/include/yaml-cpp/node/detail/node.h index cb9f196..a2cc52b 100644 --- a/include/yaml-cpp/node/detail/node.h +++ b/include/yaml-cpp/node/detail/node.h @@ -7,11 +7,11 @@ #pragma once #endif -#include "yaml-cpp/emitterstyle.h" #include "yaml-cpp/dll.h" -#include "yaml-cpp/node/type.h" -#include "yaml-cpp/node/ptr.h" +#include "yaml-cpp/emitterstyle.h" #include "yaml-cpp/node/detail/node_ref.h" +#include "yaml-cpp/node/ptr.h" +#include "yaml-cpp/node/type.h" #include namespace YAML { @@ -163,7 +163,7 @@ class node { typedef std::set nodes; nodes m_dependencies; }; -} -} +} // namespace detail +} // namespace YAML #endif // NODE_DETAIL_NODE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/node/impl.h b/include/yaml-cpp/node/impl.h index 27dba0d..8346f40 100644 --- a/include/yaml-cpp/node/impl.h +++ b/include/yaml-cpp/node/impl.h @@ -7,11 +7,11 @@ #pragma once #endif -#include "yaml-cpp/node/node.h" -#include "yaml-cpp/node/iterator.h" +#include "yaml-cpp/exceptions.h" #include "yaml-cpp/node/detail/memory.h" #include "yaml-cpp/node/detail/node.h" -#include "yaml-cpp/exceptions.h" +#include "yaml-cpp/node/iterator.h" +#include "yaml-cpp/node/node.h" #include namespace YAML { @@ -366,7 +366,7 @@ template inline typename to_value_t::return_type to_value(const T& t) { return to_value_t(t)(); } -} +} // namespace detail // indexing template @@ -374,8 +374,8 @@ inline const Node Node::operator[](const Key& key) const { if (!m_isValid) throw InvalidNode(); EnsureNodeExists(); - detail::node* value = static_cast(*m_pNode) - .get(detail::to_value(key), m_pMemory); + detail::node* value = static_cast(*m_pNode).get( + detail::to_value(key), m_pMemory); if (!value) { return Node(ZombieNode); } @@ -443,6 +443,6 @@ inline void Node::force_insert(const Key& key, const Value& value) { // free functions inline bool operator==(const Node& lhs, const Node& rhs) { return lhs.is(rhs); } -} +} // namespace YAML #endif // NODE_IMPL_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/ostream_wrapper.h b/include/yaml-cpp/ostream_wrapper.h index c3b1381..259801b 100644 --- a/include/yaml-cpp/ostream_wrapper.h +++ b/include/yaml-cpp/ostream_wrapper.h @@ -56,7 +56,7 @@ class YAML_CPP_API ostream_wrapper { template inline ostream_wrapper& operator<<(ostream_wrapper& stream, - const char(&str)[N]) { + const char (&str)[N]) { stream.write(str, N - 1); return stream; } @@ -71,6 +71,6 @@ inline ostream_wrapper& operator<<(ostream_wrapper& stream, char ch) { stream.write(&ch, 1); return stream; } -} +} // namespace YAML #endif // OSTREAM_WRAPPER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/include/yaml-cpp/parser.h b/include/yaml-cpp/parser.h index faaabb6..e9fba0c 100644 --- a/include/yaml-cpp/parser.h +++ b/include/yaml-cpp/parser.h @@ -86,6 +86,6 @@ class YAML_CPP_API Parser { std::unique_ptr m_pScanner; std::unique_ptr m_pDirectives; }; -} +} // namespace YAML #endif // PARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/collectionstack.h b/src/collectionstack.h index fcaf078..9feba96 100644 --- a/src/collectionstack.h +++ b/src/collectionstack.h @@ -7,8 +7,8 @@ #pragma once #endif -#include #include +#include namespace YAML { struct CollectionType { @@ -36,6 +36,6 @@ class CollectionStack { private: std::stack collectionStack; }; -} +} // namespace YAML #endif // COLLECTIONSTACK_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/contrib/graphbuilderadapter.h b/src/contrib/graphbuilderadapter.h index 7d5f441..e07b091 100644 --- a/src/contrib/graphbuilderadapter.h +++ b/src/contrib/graphbuilderadapter.h @@ -26,7 +26,11 @@ namespace YAML { class GraphBuilderAdapter : public EventHandler { public: GraphBuilderAdapter(GraphBuilderInterface& builder) - : m_builder(builder), m_containers{}, m_anchors{}, m_pRootNode(nullptr), m_pKeyNode(nullptr) {} + : m_builder(builder), + m_containers{}, + m_anchors{}, + m_pRootNode(nullptr), + m_pKeyNode(nullptr) {} GraphBuilderAdapter(const GraphBuilderAdapter&) = delete; GraphBuilderAdapter(GraphBuilderAdapter&&) = delete; GraphBuilderAdapter& operator=(const GraphBuilderAdapter&) = delete; @@ -78,6 +82,6 @@ class GraphBuilderAdapter : public EventHandler { void RegisterAnchor(anchor_t anchor, void* pNode); void DispositionNode(void* pNode); }; -} +} // namespace YAML #endif // GRAPHBUILDERADAPTER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/directives.cpp b/src/directives.cpp index 75f0803..0c85d0f 100644 --- a/src/directives.cpp +++ b/src/directives.cpp @@ -14,4 +14,4 @@ const std::string Directives::TranslateTagHandle( return it->second; } -} +} // namespace YAML diff --git a/src/emitfromevents.cpp b/src/emitfromevents.cpp index 27d3eb9..5a51bb4 100644 --- a/src/emitfromevents.cpp +++ b/src/emitfromevents.cpp @@ -16,10 +16,11 @@ std::string ToString(YAML::anchor_t anchor) { stream << anchor; return stream.str(); } -} +} // namespace namespace YAML { -EmitFromEvents::EmitFromEvents(Emitter& emitter) : m_emitter(emitter), m_stateStack{} {} +EmitFromEvents::EmitFromEvents(Emitter& emitter) + : m_emitter(emitter), m_stateStack{} {} void EmitFromEvents::OnDocumentStart(const Mark&) {} @@ -116,4 +117,4 @@ void EmitFromEvents::EmitProps(const std::string& tag, anchor_t anchor) { if (anchor) m_emitter << Anchor(ToString(anchor)); } -} +} // namespace YAML diff --git a/src/emitter.cpp b/src/emitter.cpp index 026f711..016beb1 100644 --- a/src/emitter.cpp +++ b/src/emitter.cpp @@ -906,4 +906,4 @@ Emitter& Emitter::Write(const Binary& binary) { return *this; } -} +} // namespace YAML diff --git a/src/emitterstate.cpp b/src/emitterstate.cpp index 5d418fe..890b4f0 100644 --- a/src/emitterstate.cpp +++ b/src/emitterstate.cpp @@ -30,8 +30,7 @@ EmitterState::EmitterState() m_hasAnchor(false), m_hasTag(false), m_hasNonContent(false), - m_docCount(0) -{} + m_docCount(0) {} EmitterState::~EmitterState() {} @@ -367,4 +366,4 @@ bool EmitterState::SetDoublePrecision(std::size_t value, _Set(m_doublePrecision, value, scope); return true; } -} +} // namespace YAML diff --git a/src/emitterstate.h b/src/emitterstate.h index 11ac223..75e2166 100644 --- a/src/emitterstate.h +++ b/src/emitterstate.h @@ -145,7 +145,12 @@ class EmitterState { struct Group { explicit Group(GroupType::value type_) - : type(type_), flowType{}, indent(0), childCount(0), longKey(false), modifiedSettings{} {} + : type(type_), + flowType{}, + indent(0), + childCount(0), + longKey(false), + modifiedSettings{} {} GroupType::value type; FlowType::value flowType; @@ -198,6 +203,6 @@ void EmitterState::_Set(Setting& fmt, T value, FmtScope::value scope) { assert(false); } } -} +} // namespace YAML #endif // EMITTERSTATE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/emitterutils.cpp b/src/emitterutils.cpp index e4b87dd..e348599 100644 --- a/src/emitterutils.cpp +++ b/src/emitterutils.cpp @@ -8,8 +8,8 @@ #include "regeximpl.h" #include "stringsource.h" #include "yaml-cpp/binary.h" // IWYU pragma: keep -#include "yaml-cpp/ostream_wrapper.h" #include "yaml-cpp/null.h" +#include "yaml-cpp/ostream_wrapper.h" namespace YAML { namespace Utils { @@ -258,7 +258,7 @@ bool WriteAliasName(ostream_wrapper& out, const std::string& str) { } return true; } -} +} // namespace StringFormat::value ComputeStringFormat(const std::string& str, EMITTER_MANIP strFormat, @@ -401,8 +401,8 @@ bool WriteComment(ostream_wrapper& out, const std::string& str, for (std::string::const_iterator i = str.begin(); GetNextCodePointAndAdvance(codePoint, i, str.end());) { if (codePoint == '\n') { - out << "\n" << IndentTo(curIndent) << "#" - << Indentation(postCommentIndent); + out << "\n" + << IndentTo(curIndent) << "#" << Indentation(postCommentIndent); out.set_comment(); } else { WriteCodePoint(out, codePoint); @@ -479,5 +479,5 @@ bool WriteBinary(ostream_wrapper& out, const Binary& binary) { false); return true; } -} -} +} // namespace Utils +} // namespace YAML diff --git a/src/node_data.cpp b/src/node_data.cpp index c54b0a6..c65accb 100644 --- a/src/node_data.cpp +++ b/src/node_data.cpp @@ -14,8 +14,8 @@ namespace YAML { namespace detail { const std::string& node_data::empty_scalar() { - static const std::string svalue; - return svalue; + static const std::string svalue; + return svalue; } node_data::node_data() @@ -28,8 +28,7 @@ node_data::node_data() m_sequence{}, m_seqSize(0), m_map{}, - m_undefinedPairs{} -{} + m_undefinedPairs{} {} void node_data::mark_defined() { if (m_type == NodeType::Undefined) @@ -244,7 +243,8 @@ bool node_data::remove(node& key, shared_memory_holder /* pMemory */) { if (m_type != NodeType::Map) return false; - for(kv_pairs::iterator it = m_undefinedPairs.begin(); it != m_undefinedPairs.end();) { + for (kv_pairs::iterator it = m_undefinedPairs.begin(); + it != m_undefinedPairs.end();) { kv_pairs::iterator jt = std::next(it); if (it->first->is(key)) m_undefinedPairs.erase(it); @@ -312,5 +312,5 @@ void node_data::convert_sequence_to_map(shared_memory_holder pMemory) { reset_sequence(); m_type = NodeType::Map; } -} -} +} // namespace detail +} // namespace YAML diff --git a/src/nodebuilder.cpp b/src/nodebuilder.cpp index ad9bf55..c90a66c 100644 --- a/src/nodebuilder.cpp +++ b/src/nodebuilder.cpp @@ -16,8 +16,7 @@ NodeBuilder::NodeBuilder() m_stack{}, m_anchors{}, m_keys{}, - m_mapDepth(0) -{ + m_mapDepth(0) { m_anchors.push_back(nullptr); // since the anchors start at 1 } @@ -133,4 +132,4 @@ void NodeBuilder::RegisterAnchor(anchor_t anchor, detail::node& node) { m_anchors.push_back(&node); } } -} +} // namespace YAML diff --git a/src/nodebuilder.h b/src/nodebuilder.h index f89620a..642da36 100644 --- a/src/nodebuilder.h +++ b/src/nodebuilder.h @@ -69,6 +69,6 @@ class NodeBuilder : public EventHandler { std::vector m_keys; std::size_t m_mapDepth; }; -} +} // namespace YAML #endif // NODE_NODEBUILDER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/nodeevents.cpp b/src/nodeevents.cpp index bfbe1b6..b7222e0 100644 --- a/src/nodeevents.cpp +++ b/src/nodeevents.cpp @@ -98,4 +98,4 @@ bool NodeEvents::IsAliased(const detail::node& node) const { RefCount::const_iterator it = m_refCount.find(node.ref()); return it != m_refCount.end() && it->second > 1; } -} +} // namespace YAML diff --git a/src/nodeevents.h b/src/nodeevents.h index 0690572..dbed5d2 100644 --- a/src/nodeevents.h +++ b/src/nodeevents.h @@ -63,6 +63,6 @@ class NodeEvents { typedef std::map RefCount; RefCount m_refCount; }; -} +} // namespace YAML #endif // NODE_NODEEVENTS_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/ostream_wrapper.cpp b/src/ostream_wrapper.cpp index dd16373..5fa5858 100644 --- a/src/ostream_wrapper.cpp +++ b/src/ostream_wrapper.cpp @@ -14,7 +14,12 @@ ostream_wrapper::ostream_wrapper() m_comment(false) {} ostream_wrapper::ostream_wrapper(std::ostream& stream) - : m_buffer{}, m_pStream(&stream), m_pos(0), m_row(0), m_col(0), m_comment(false) {} + : m_buffer{}, + m_pStream(&stream), + m_pos(0), + m_row(0), + m_col(0), + m_comment(false) {} ostream_wrapper::~ostream_wrapper() {} @@ -54,4 +59,4 @@ void ostream_wrapper::update_pos(char ch) { m_comment = false; } } -} +} // namespace YAML diff --git a/src/parser.cpp b/src/parser.cpp index b7a4fd5..7bc0c78 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -126,4 +126,4 @@ void Parser::PrintTokens(std::ostream& out) { m_pScanner->pop(); } } -} +} // namespace YAML diff --git a/src/ptr_vector.h b/src/ptr_vector.h index 1c7e40c..d58de04 100644 --- a/src/ptr_vector.h +++ b/src/ptr_vector.h @@ -40,6 +40,6 @@ class ptr_vector { private: std::vector> m_data; }; -} +} // namespace YAML #endif // PTR_VECTOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/regex_yaml.cpp b/src/regex_yaml.cpp index f8b5130..bf1784b 100644 --- a/src/regex_yaml.cpp +++ b/src/regex_yaml.cpp @@ -10,7 +10,8 @@ RegEx::RegEx(char ch) : m_op(REGEX_MATCH), m_a(ch), m_z(0), m_params{} {} RegEx::RegEx(char a, char z) : m_op(REGEX_RANGE), m_a(a), m_z(z), m_params{} {} -RegEx::RegEx(const std::string& str, REGEX_OP op) : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {} +RegEx::RegEx(const std::string& str, REGEX_OP op) + : m_op(op), m_a(0), m_z(0), m_params(str.begin(), str.end()) {} // combination constructors RegEx operator!(const RegEx& ex) { @@ -39,4 +40,4 @@ RegEx operator+(const RegEx& ex1, const RegEx& ex2) { ret.m_params.push_back(ex2); return ret; } -} +} // namespace YAML diff --git a/src/scanner.cpp b/src/scanner.cpp index 61beaac..ac84892 100644 --- a/src/scanner.cpp +++ b/src/scanner.cpp @@ -17,8 +17,7 @@ Scanner::Scanner(std::istream& in) m_simpleKeys{}, m_indents{}, m_indentRefs{}, - m_flows{} -{} + m_flows{} {} Scanner::~Scanner() {} diff --git a/src/scantoken.cpp b/src/scantoken.cpp index 27e5e3e..325de57 100644 --- a/src/scantoken.cpp +++ b/src/scantoken.cpp @@ -434,4 +434,4 @@ void Scanner::ScanBlockScalar() { token.value = scalar; m_tokens.push(token); } -} +} // namespace YAML diff --git a/src/setting.h b/src/setting.h index 62a24ee..280d1e7 100644 --- a/src/setting.h +++ b/src/setting.h @@ -8,8 +8,8 @@ #endif #include -#include #include +#include namespace YAML { class SettingChangeBase; @@ -18,9 +18,7 @@ template class Setting { public: Setting() : m_value() {} - Setting(const T& value) : m_value() { - set(value); - } + Setting(const T& value) : m_value() { set(value); } const T get() const { return m_value; } std::unique_ptr set(const T& value); @@ -39,9 +37,9 @@ class SettingChangeBase { template class SettingChange : public SettingChangeBase { public: - SettingChange(Setting* pSetting) : - m_pCurSetting(pSetting), - m_oldSetting(*pSetting) // copy old setting to save its state + SettingChange(Setting* pSetting) + : m_pCurSetting(pSetting), + m_oldSetting(*pSetting) // copy old setting to save its state {} SettingChange(const SettingChange&) = delete; SettingChange(SettingChange&&) = delete; @@ -66,7 +64,7 @@ class SettingChanges { public: SettingChanges() : m_settingChanges{} {} SettingChanges(const SettingChanges&) = delete; - SettingChanges(SettingChanges&& rhs) : m_settingChanges(std::move(rhs.m_settingChanges)) {} + SettingChanges(SettingChanges&&) = default; SettingChanges& operator=(const SettingChanges&) = delete; ~SettingChanges() { clear(); } @@ -100,6 +98,6 @@ class SettingChanges { typedef std::vector> setting_changes; setting_changes m_settingChanges; }; -} +} // namespace YAML #endif // SETTING_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/singledocparser.cpp b/src/singledocparser.cpp index b18e386..3c294ca 100644 --- a/src/singledocparser.cpp +++ b/src/singledocparser.cpp @@ -19,8 +19,7 @@ SingleDocParser::SingleDocParser(Scanner& scanner, const Directives& directives) m_directives(directives), m_pCollectionStack(new CollectionStack), m_anchors{}, - m_curAnchor(0) -{} + m_curAnchor(0) {} SingleDocParser::~SingleDocParser() {} @@ -413,4 +412,4 @@ anchor_t SingleDocParser::LookupAnchor(const Mark& mark, return it->second; } -} +} // namespace YAML diff --git a/src/singledocparser.h b/src/singledocparser.h index fc7f835..cd7cbc3 100644 --- a/src/singledocparser.h +++ b/src/singledocparser.h @@ -63,6 +63,6 @@ class SingleDocParser { anchor_t m_curAnchor; }; -} +} // namespace YAML #endif // SINGLEDOCPARSER_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/stream.cpp b/src/stream.cpp index 88a3d6b..592802d 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -111,24 +111,15 @@ static UtfIntroState s_introTransitions[][uictMax] = { static char s_introUngetCount[][uictMax] = { // uict00, uictBB, uictBF, uictEF, uictFE, uictFF, uictAscii, uictOther - {0, 1, 1, 0, 0, 0, 0, 1}, - {0, 2, 2, 2, 2, 2, 2, 2}, - {3, 3, 3, 3, 0, 3, 3, 3}, - {4, 4, 4, 4, 4, 0, 4, 4}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {2, 2, 2, 2, 2, 0, 2, 2}, - {2, 2, 2, 2, 0, 2, 2, 2}, - {0, 1, 1, 1, 1, 1, 1, 1}, - {0, 2, 2, 2, 2, 2, 2, 2}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {1, 1, 1, 1, 1, 1, 1, 1}, - {0, 2, 2, 2, 2, 2, 2, 2}, - {0, 3, 3, 3, 3, 3, 3, 3}, - {4, 4, 4, 4, 4, 4, 4, 4}, - {2, 0, 2, 2, 2, 2, 2, 2}, - {3, 3, 0, 3, 3, 3, 3, 3}, - {1, 1, 1, 1, 1, 1, 1, 1}, + {0, 1, 1, 0, 0, 0, 0, 1}, {0, 2, 2, 2, 2, 2, 2, 2}, + {3, 3, 3, 3, 0, 3, 3, 3}, {4, 4, 4, 4, 4, 0, 4, 4}, + {1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1}, + {2, 2, 2, 2, 2, 0, 2, 2}, {2, 2, 2, 2, 0, 2, 2, 2}, + {0, 1, 1, 1, 1, 1, 1, 1}, {0, 2, 2, 2, 2, 2, 2, 2}, + {1, 1, 1, 1, 1, 1, 1, 1}, {1, 1, 1, 1, 1, 1, 1, 1}, + {0, 2, 2, 2, 2, 2, 2, 2}, {0, 3, 3, 3, 3, 3, 3, 3}, + {4, 4, 4, 4, 4, 4, 4, 4}, {2, 0, 2, 2, 2, 2, 2, 2}, + {3, 3, 0, 3, 3, 3, 3, 3}, {1, 1, 1, 1, 1, 1, 1, 1}, }; inline UtfIntroCharType IntroCharTypeOf(std::istream::int_type ch) { @@ -197,8 +188,7 @@ Stream::Stream(std::istream& input) m_readahead{}, m_pPrefetched(new unsigned char[YAML_PREFETCH_SIZE]), m_nPrefetchedAvailable(0), - m_nPrefetchedUsed(0) -{ + m_nPrefetchedUsed(0) { typedef std::istream::traits_type char_traits; if (!input) @@ -449,4 +439,4 @@ void Stream::StreamInUtf32() const { QueueUnicodeCodepoint(m_readahead, ch); } -} +} // namespace YAML diff --git a/src/stream.h b/src/stream.h index 69f8372..ff5149e 100644 --- a/src/stream.h +++ b/src/stream.h @@ -74,6 +74,6 @@ inline bool Stream::ReadAheadTo(size_t i) const { return true; return _ReadAheadTo(i); } -} +} // namespace YAML #endif // STREAM_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/streamcharsource.h b/src/streamcharsource.h index 9ba5948..4b6a143 100644 --- a/src/streamcharsource.h +++ b/src/streamcharsource.h @@ -43,6 +43,6 @@ inline const StreamCharSource StreamCharSource::operator+(int i) const { source.m_offset = 0; return source; } -} +} // namespace YAML #endif // STREAMCHARSOURCE_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/src/tag.cpp b/src/tag.cpp index b1acd9e..df8a2cf 100644 --- a/src/tag.cpp +++ b/src/tag.cpp @@ -6,7 +6,8 @@ #include "token.h" namespace YAML { -Tag::Tag(const Token& token) : type(static_cast(token.data)), handle{}, value{} { +Tag::Tag(const Token& token) + : type(static_cast(token.data)), handle{}, value{} { switch (type) { case VERBATIM: value = token.value; @@ -46,4 +47,4 @@ const std::string Tag::Translate(const Directives& directives) { } throw std::runtime_error("yaml-cpp: internal error, bad tag type"); } -} +} // namespace YAML diff --git a/src/token.h b/src/token.h index 2d2790e..9a27f3d 100644 --- a/src/token.h +++ b/src/token.h @@ -14,10 +14,11 @@ namespace YAML { const std::string TokenNames[] = { - "DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START", "BLOCK_MAP_START", - "BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY", "FLOW_SEQ_START", - "FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END", "FLOW_MAP_COMPACT", - "FLOW_ENTRY", "KEY", "VALUE", "ANCHOR", "ALIAS", "TAG", "SCALAR"}; + "DIRECTIVE", "DOC_START", "DOC_END", "BLOCK_SEQ_START", + "BLOCK_MAP_START", "BLOCK_SEQ_END", "BLOCK_MAP_END", "BLOCK_ENTRY", + "FLOW_SEQ_START", "FLOW_MAP_START", "FLOW_SEQ_END", "FLOW_MAP_END", + "FLOW_MAP_COMPACT", "FLOW_ENTRY", "KEY", "VALUE", + "ANCHOR", "ALIAS", "TAG", "SCALAR"}; struct Token { // enums @@ -64,6 +65,6 @@ struct Token { std::vector params; int data; }; -} +} // namespace YAML #endif // TOKEN_H_62B23520_7C8E_11DE_8A39_0800200C9A66 diff --git a/test/regex_test.cpp b/test/regex_test.cpp index 51c1435..658db9e 100644 --- a/test/regex_test.cpp +++ b/test/regex_test.cpp @@ -1,6 +1,6 @@ -#include "gtest/gtest.h" #include "regex_yaml.h" #include "stream.h" +#include "gtest/gtest.h" using YAML::RegEx; using YAML::Stream; @@ -174,4 +174,4 @@ TEST(RegExTest, StringOr) { EXPECT_EQ(1, ex.Match(str)); } -} +} // namespace