scanscalar.h
Go to the documentation of this file.
00001 #ifndef SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
00002 #define SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
00003 
00004 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
00005 #pragma once
00006 #endif
00007 
00008 
00009 #include <string>
00010 #include "regex.h"
00011 #include "stream.h"
00012 
00013 namespace YAML_PM
00014 {
00015         enum CHOMP { STRIP = -1, CLIP, KEEP };
00016         enum ACTION { NONE, BREAK, THROW };
00017         enum FOLD { DONT_FOLD, FOLD_BLOCK, FOLD_FLOW };
00018 
00019         struct ScanScalarParams {
00020                 ScanScalarParams(): eatEnd(false), indent(0), detectIndent(false), eatLeadingWhitespace(0), escape(0), fold(DONT_FOLD),
00021                         trimTrailingSpaces(0), chomp(CLIP), onDocIndicator(NONE), onTabInIndentation(NONE), leadingSpaces(false) {}
00022 
00023                 // input:
00024                 RegEx end;                      // what condition ends this scalar?
00025                 bool eatEnd;                    // should we eat that condition when we see it?
00026                 int indent;                     // what level of indentation should be eaten and ignored?
00027                 bool detectIndent;              // should we try to autodetect the indent?
00028                 bool eatLeadingWhitespace;      // should we continue eating this delicious indentation after 'indent' spaces?
00029                 char escape;                    // what character do we escape on (i.e., slash or single quote) (0 for none)
00030                 FOLD fold;                      // how do we fold line ends?
00031                 bool trimTrailingSpaces;        // do we remove all trailing spaces (at the very end)
00032                 CHOMP chomp;                    // do we strip, clip, or keep trailing newlines (at the very end)
00033                                                 //   Note: strip means kill all, clip means keep at most one, keep means keep all
00034                 ACTION onDocIndicator;          // what do we do if we see a document indicator?
00035                 ACTION onTabInIndentation;      // what do we do if we see a tab where we should be seeing indentation spaces
00036 
00037                 // output:
00038                 bool leadingSpaces;
00039         };
00040 
00041         std::string ScanScalar(Stream& INPUT, ScanScalarParams& info);
00042 }
00043 
00044 #endif // SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
00045 


libpointmatcher
Author(s):
autogenerated on Thu Jun 20 2019 19:51:32