File indexing completed on 2025-05-12 09:08:10
0001 #ifndef SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
0002 #define SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66
0003
0004 #if defined(_MSC_VER) || \
0005 (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \
0006 (__GNUC__ >= 4))
0007 #pragma once
0008 #endif
0009
0010 #include <string>
0011
0012 #include "regex_yaml.h"
0013 #include "stream.h"
0014
0015 namespace SHERPA_YAML {
0016 enum CHOMP { STRIP = -1, CLIP, KEEP };
0017 enum ACTION { NONE, BREAK, THROW };
0018 enum FOLD { DONT_FOLD, FOLD_BLOCK, FOLD_FLOW };
0019
0020 struct ScanScalarParams {
0021 ScanScalarParams()
0022 : end(nullptr),
0023 eatEnd(false),
0024 indent(0),
0025 detectIndent(false),
0026 eatLeadingWhitespace(0),
0027 escape(0),
0028 fold(DONT_FOLD),
0029 trimTrailingSpaces(0),
0030 chomp(CLIP),
0031 onDocIndicator(NONE),
0032 onTabInIndentation(NONE),
0033 leadingSpaces(false) {}
0034
0035
0036 const RegEx* end;
0037
0038 bool eatEnd;
0039 int indent;
0040 bool detectIndent;
0041 bool eatLeadingWhitespace;
0042
0043 char escape;
0044
0045 FOLD fold;
0046 bool trimTrailingSpaces;
0047
0048 CHOMP chomp;
0049
0050
0051
0052 ACTION onDocIndicator;
0053 ACTION onTabInIndentation;
0054
0055
0056
0057 bool leadingSpaces;
0058 };
0059
0060 std::string ScanScalar(Stream& INPUT, ScanScalarParams& params);
0061 }
0062
0063 #endif