Menu

[6d9522]: / examples / mist_gen / src / Common.h  Maximize  Restore  History

Download this file

44 lines (33 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef COMMON_H_1854_INCLUDED
#define COMMON_H_1854_INCLUDED
#include <string>
#include <vector>
// Common declarations
///////////////////////////////////////////////////////////////////////
// This structure represents a (name, value) pair.
struct CValue
{
std::string name;
std::string value;
};
///////////////////////////////////////////////////////////////////////
// Whitespace characters (defined in Common.cpp)
extern const std::string whitespaceList;
// Names of the "document" and "block" groups (defined in Common.cpp)
extern const std::string documentGroupName;
extern const std::string blockGroupName;
///////////////////////////////////////////////////////////////////////
// Helper functions
// Trims the whitespace characters off the string (remove them from both
// the beginning and the end).
void
trimString(std::string& s);
// Formats the message like the follwing: "line <n>: <text>"
std::string
formatErrorMessage(int lineNumber, const std::string& text);
///////////////////////////////////////////////////////////////////////
// Type definitions
// A type for a collection of values.
typedef std::vector<CValue> ValueList;
///////////////////////////////////////////////////////////////////////
#endif // COMMON_H_1854_INCLUDED