Commit Graph

11 Commits

Author SHA1 Message Date
Ted Lyngmo
3f4bdb9878 Make pseudo enum classes into proper enum classes
This changes some constructs like this

    struct FmtScope {
      enum value { Local, Global };
    };
    struct GroupType {
      enum value { NoType, Seq, Map };
    };
    struct FlowType {
      enum value { NoType, Flow, Block };
    };

into this

    enum class FmtScope { Local, Global };
    enum class GroupType { NoType, Seq, Map };
    enum class FlowType { NoType, Flow, Block };

The full list of pseudo enum classes now turned into real enum classes:

enum class State { WaitingForSequenceEntry, WaitingForKey, WaitingForValue };
enum class EmitterNodeType { NoType, Property, Scalar, FlowSeq, BlockSeq, FlowMap, BlockMap };
enum class Type { Verbatim, PrimaryHandle, NamedHandle };
enum class EmitterStyle { Default, Block, Flow };
enum class iterator_type { NoneType, Sequence, Map };
enum class NodeType { Undefined, Null, Scalar, Sequence, Map };
enum class CollectionType { NoCollection, BlockMap, BlockSeq, FlowMap, FlowSeq, CompactMap };
enum class FmtScope { Local, Global };
enum class GroupType { NoType, Seq, Map };
enum class FlowType { NoType, Flow, Block };
enum class StringFormat { Plain, SingleQuoted, DoubleQuoted, Literal };
enum class StringEscaping { None, NonAscii, JSON };

Signed-off-by: Ted Lyngmo <ted@lyncon.se>
2021-04-23 10:15:50 +02:00
Ted Lyngmo
0d5c57150c Apply formatting/style tweaks to comply with compile time diagnostics for g++ and clang++ (#686)
* Add compilation flags: -Wshadow -Weffc++ -pedantic -pedantic-errors
* Delete implicit copy & move constructors & assignment operators
  in classes with pointer data members.
* An exception to the above: Add default copy & move constructors &
  assignment operators for the Binary class.
* Convert boolean RegEx operators to binary operators.
* Initialize all members in all classes in ctors.
* Let default ctor delegate to the converting ctor in
  Binary and RegEx
* Don't change any tests except regex_test (as a result of the change
  to binary operators).

Note: https://bugzilla.redhat.com/show_bug.cgi?id=1544675 makes
-Weffc++ report a false positive in "include/yaml-cpp/node/impl.h".
2019-03-13 15:18:34 -07:00
Alexander
1698b47b65 Use nullptr instead of 0 or NULL (clang-tidy warns) (#603) 2018-07-02 23:59:04 -05:00
Jesse Beder
ad712c4f2d Add EmitterStyle, which will allow sequence or map style (i.e., flow or block) to be preserved between parsing and emitting 2015-01-24 12:19:20 -06:00
Jesse Beder
5fd25df859 Run IWYU 2014-03-22 22:46:04 -05:00
Jesse Beder
9b4db068bb Run clang-format 2014-03-22 12:49:16 -05:00
Jesse Beder
3e94c0a037 Switched the 'pragma once' to only happen on MSVC, or gcc >= 3.4 (it was causing trouble on the sun compiler) 2011-09-06 00:16:03 -05:00
Jesse Beder
9fbcfe9ec5 Added include <cstdlib> for using 'NULL' (apparently gcc 4.6 is more strict) 2011-05-03 21:55:49 +00:00
Jesse Beder
ca5992b971 Merged r444:449 from the node refactoring branch to the trunk 2011-03-03 00:19:26 +00:00
Jesse Beder
f34d60ca65 Flipped the include guard and the pragma, and don't use the pragma for early versions of gcc (< 3.4) 2011-03-02 06:11:41 +00:00
Jesse Beder
802cc6bcd6 Merged contrib folders from the graphbuilder-api branch, including the recursive search in CMakeLists.txt 2011-03-02 04:48:04 +00:00