3rdparty
libpointmatcher
contrib
yaml-cpp-pm
src
scanscalar.h
Go to the documentation of this file.
1
#ifndef SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
2
#define SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
3
4
#if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
5
#pragma once
6
#endif
7
8
9
#include <string>
10
#include "
regex.h
"
11
#include "
stream.h
"
12
13
namespace
YAML_PM
14
{
15
enum
CHOMP
{
STRIP
= -1,
CLIP
,
KEEP
};
16
enum
ACTION
{
NONE
,
BREAK
,
THROW
};
17
enum
FOLD
{
DONT_FOLD
,
FOLD_BLOCK
,
FOLD_FLOW
};
18
19
struct
ScanScalarParams
{
20
ScanScalarParams
():
eatEnd
(false),
indent
(0),
detectIndent
(false),
eatLeadingWhitespace
(0),
escape
(0),
fold
(
DONT_FOLD
),
21
trimTrailingSpaces
(0),
chomp
(
CLIP
),
onDocIndicator
(
NONE
),
onTabInIndentation
(
NONE
),
leadingSpaces
(false) {}
22
23
// input:
24
RegEx
end
;
// what condition ends this scalar?
25
bool
eatEnd
;
// should we eat that condition when we see it?
26
int
indent
;
// what level of indentation should be eaten and ignored?
27
bool
detectIndent
;
// should we try to autodetect the indent?
28
bool
eatLeadingWhitespace
;
// should we continue eating this delicious indentation after 'indent' spaces?
29
char
escape
;
// what character do we escape on (i.e., slash or single quote) (0 for none)
30
FOLD
fold
;
// how do we fold line ends?
31
bool
trimTrailingSpaces
;
// do we remove all trailing spaces (at the very end)
32
CHOMP
chomp
;
// do we strip, clip, or keep trailing newlines (at the very end)
33
// Note: strip means kill all, clip means keep at most one, keep means keep all
34
ACTION
onDocIndicator
;
// what do we do if we see a document indicator?
35
ACTION
onTabInIndentation
;
// what do we do if we see a tab where we should be seeing indentation spaces
36
37
// output:
38
bool
leadingSpaces
;
39
};
40
41
std::string
ScanScalar
(
Stream
& INPUT,
ScanScalarParams
& info);
42
}
43
44
#endif // SCANSCALAR_H_62B23520_7C8E_11DE_8A39_0800200C9A66_PM
45
YAML_PM::STRIP
@ STRIP
Definition:
scanscalar.h:15
YAML_PM::ScanScalarParams
Definition:
scanscalar.h:19
YAML_PM::ScanScalarParams::chomp
CHOMP chomp
Definition:
scanscalar.h:32
YAML_PM::ScanScalarParams::leadingSpaces
bool leadingSpaces
Definition:
scanscalar.h:38
YAML_PM::ScanScalarParams::eatLeadingWhitespace
bool eatLeadingWhitespace
Definition:
scanscalar.h:28
YAML_PM
Definition:
aliasmanager.h:11
YAML_PM::KEEP
@ KEEP
Definition:
scanscalar.h:15
YAML_PM::ScanScalarParams::eatEnd
bool eatEnd
Definition:
scanscalar.h:25
YAML_PM::ScanScalarParams::detectIndent
bool detectIndent
Definition:
scanscalar.h:27
YAML_PM::ScanScalar
std::string ScanScalar(Stream &INPUT, ScanScalarParams ¶ms)
Definition:
scanscalar.cpp:19
YAML_PM::ACTION
ACTION
Definition:
scanscalar.h:16
YAML_PM::ScanScalarParams::onDocIndicator
ACTION onDocIndicator
Definition:
scanscalar.h:34
YAML_PM::NONE
@ NONE
Definition:
scanscalar.h:16
testing::internal::string
::std::string string
Definition:
gtest.h:1979
YAML_PM::ScanScalarParams::onTabInIndentation
ACTION onTabInIndentation
Definition:
scanscalar.h:35
YAML_PM::ScanScalarParams::trimTrailingSpaces
bool trimTrailingSpaces
Definition:
scanscalar.h:31
YAML_PM::BREAK
@ BREAK
Definition:
scanscalar.h:16
stream.h
YAML_PM::THROW
@ THROW
Definition:
scanscalar.h:16
YAML_PM::DONT_FOLD
@ DONT_FOLD
Definition:
scanscalar.h:17
YAML_PM::ScanScalarParams::indent
int indent
Definition:
scanscalar.h:26
regex.h
YAML_PM::RegEx
Definition:
regex.h:21
YAML_PM::FOLD_FLOW
@ FOLD_FLOW
Definition:
scanscalar.h:17
YAML_PM::CHOMP
CHOMP
Definition:
scanscalar.h:15
YAML_PM::FOLD
FOLD
Definition:
scanscalar.h:17
YAML_PM::ScanScalarParams::fold
FOLD fold
Definition:
scanscalar.h:30
YAML_PM::CLIP
@ CLIP
Definition:
scanscalar.h:15
YAML_PM::Stream
Definition:
stream.h:20
YAML_PM::ScanScalarParams::escape
char escape
Definition:
scanscalar.h:29
YAML_PM::ScanScalarParams::end
RegEx end
Definition:
scanscalar.h:24
YAML_PM::ScanScalarParams::ScanScalarParams
ScanScalarParams()
Definition:
scanscalar.h:20
YAML_PM::FOLD_BLOCK
@ FOLD_BLOCK
Definition:
scanscalar.h:17
mp2p_icp
Author(s):
autogenerated on Fri Dec 20 2024 03:46:00