当前位置: 首页>>代码示例>>C++>>正文


C++ Appender::append方法代码示例

本文整理汇总了C++中Appender::append方法的典型用法代码示例。如果您正苦于以下问题:C++ Appender::append方法的具体用法?C++ Appender::append怎么用?C++ Appender::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Appender的用法示例。


在下文中一共展示了Appender::append方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: writeArray

		void Writer::writeArray(Appender& appender, const Value& value, Size indent)
		{
			appender.append("[" + lineBreak());
			for (Size i = 0; i < value.getLength(); i++)
			{
				appender.append(space(indent + 1));
				write(appender, value.get(i), indent + 1);
				if (i + 1 != value.getLength())
				{
					appender.append(",");
				}
				appender.append(lineBreak());
			}
			appender.append(space(indent) + "]");
		}
开发者ID:marcellus-trixus,项目名称:duel6r,代码行数:15,代码来源:JsonWriter.cpp

示例2: writeObject

		void Writer::writeObject(Appender& appender, const Value& value, Size indent)
		{
			appender.append("{" + lineBreak());
			auto propNames = value.getPropertyNames();
			for (Size i = 0; i < propNames.size(); i++)
			{
				const std::string& name = propNames[i];
				appender.append(space(indent + 1) + '"' + name + "\": ");
				write(appender, value.get(name), indent + 1);
				if (i + 1 != propNames.size())
				{
					appender.append(",");
				}
				appender.append(lineBreak());
			}
			appender.append(space(indent) + "}");
		}
开发者ID:marcellus-trixus,项目名称:duel6r,代码行数:17,代码来源:JsonWriter.cpp

示例3: dispatch_to_string

		size_t dispatch_to_string(const Arg& arg, Appender& app, FmtFlags flags,
								  integral_constant<bool, false> has_overload2_opt,
								  integral_constant<bool, true> has_overload1_opt,
								  integral_constant<bool, b1> has_overload2,
								  integral_constant<bool, b2> has_overload1)
		{
			auto string = to_string(arg, flags);
			app.append(string);
			return string.size();
		}
开发者ID:mknejp,项目名称:std-format,代码行数:10,代码来源:dispatch_to_string.hpp

示例4: generic_append

		void generic_append(char const *begin,char const *end,Appender &a)
		{
			a.append('"');
			char const *i,*last;
			char buf[8] = "\\u00";
			for(i=begin,last = begin;i!=end;) {
				char const *addon = 0;
				unsigned char c=*i;
				switch(c) {
				case 0x22: addon = "\\\""; break;
				case 0x5C: addon = "\\\\"; break;
				case '\b': addon = "\\b"; break;
				case '\f': addon = "\\f"; break;
				case '\n': addon = "\\n"; break;
				case '\r': addon = "\\r"; break;
				case '\t': addon = "\\t"; break;
				default:
					if(c<=0x1F) {
						static char const tohex[]="0123456789abcdef";
						buf[4]=tohex[c >>  4];
						buf[5]=tohex[c & 0xF];
						buf[6]=0;
						addon = buf;
					}
				};
				if(addon) {
					a.append(last,i-last);
					a.append(addon);
					i++;
					last = i;
				}
				else {
					i++;
				}
			}
			a.append(last,i-last);
			a.append('"');
		}
开发者ID:klupek,项目名称:cppcms,代码行数:38,代码来源:json.cpp

示例5: processSerialCommands

// gather command from serial input
// this may be performed in multiple passes - only a newline (not stored) marks command ready to process
void processSerialCommands() {
	int inch;

	// append any newly arrived chars & execute command if return received
	while ((inch = Serial.read()) >= 0) {
		if (inch == '\n') { // end of line
			if(doCommand(commandBuffer)) {
				showPrompt();
			}

			commandAp.reset();
			return; // process at most one command per loop
		}
		else { // continue line
			commandAp.append((char) inch);
		}
	}
}
开发者ID:RobertLeyland,项目名称:chirpino,代码行数:20,代码来源:Commands.cpp

示例6: assertString

 void assertString(const vespalib::string &input, const vespalib::string &output) {
     std::vector<char> buf;
     _appender.append(buf, input.c_str(), input.size());
     EXPECT_EQUAL(output, vespalib::string(&buf[0], buf.size()));
 }
开发者ID:songhtdo,项目名称:vespa,代码行数:5,代码来源:appender_test.cpp

示例7: writeString

		void Writer::writeString(Appender& appender, const std::string& value)
		{
			appender.append('"' + value + '"');
		}
开发者ID:marcellus-trixus,项目名称:duel6r,代码行数:4,代码来源:JsonWriter.cpp

示例8: writeNumber

		void Writer::writeNumber(Appender& appender, Float64 value)
		{
			appender.append(std::floor(value) == value ? std::to_string((Int32) value) : std::to_string(value));
		}
开发者ID:marcellus-trixus,项目名称:duel6r,代码行数:4,代码来源:JsonWriter.cpp

示例9: writeBoolean

		void Writer::writeBoolean(Appender& appender, bool value)
		{
			appender.append(value ? "true" : "false");
		}
开发者ID:marcellus-trixus,项目名称:duel6r,代码行数:4,代码来源:JsonWriter.cpp

示例10: writeNull

		void Writer::writeNull(Appender& appender)
		{
			appender.append("null");
		}
开发者ID:marcellus-trixus,项目名称:duel6r,代码行数:4,代码来源:JsonWriter.cpp


注:本文中的Appender::append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。