29 #include YFM_NPL_Configuration
30 #include YFM_NPL_SContext
32 using namespace YSLib;
42 WritePrefix(
File&
f,
size_t n = 1,
char c =
'\t')
55 for(
const auto& n : node)
57 WritePrefix(f, depth);
61 WriteNode(f, n, depth + 1);
63 catch(std::out_of_range&)
65 WritePrefix(f, depth);
74 EscapeNodeString(
const string& str)
79 return c == char() ? std::move(content) :
c + content +
c;
88 const auto&
s(Access<string>(node));
90 f <<
'"' << EscapeNodeString(
s) <<
'"' <<
'\n';
102 WritePrefix(f, depth);
107 if(PrintNodeString(f, node))
110 for(
const auto& n : node)
112 WritePrefix(f, depth);
114 PrintNodeString(f, n);
120 WriteNodeC(f, n, depth + 1);
122 catch(std::out_of_range&)
124 WritePrefix(f, depth);
137 return WriteNodeC(f, conf.GetRoot(), 0);
YF_API string MakeEscape(const string &)
转义字符串:替换指定字符串中的可转义字符。
YF_API bool IsPrefixedIndex(const string &, char= '$')
判断字符串是否是一个指定字符和非负整数的组合。
_tString get_mid(const _tString &str, typename _tString::size_type l=1)
取删除前缀和后缀的子字符串。
YF_API ValueNode LoadNPLA1(ValueNode &&)
读取 NPLA1 翻译单元。
YF_API void Analyze(ValueNode &, const TokenList &)
分析指定源,取抽象语法树储存至指定值类型节点。
TextFile & operator>>(TextFile &tf, Configuration &conf)
YF_API char CheckLiteral(const string &)
检查指定字符串是否为字面量。
void Rewind() const
设置文件读位置为文本区段头。
Container Value const string name size_t GetSize() const ynothrow
File & operator<<(File &f, const Configuration &conf)