示例#1
0
	void process( QFile &file, const Billon &billon )
	{
		QXmlStreamWriter stream;
		init(file,stream);
		appendTags( stream, billon );
		appendPith( stream, billon, 0 );
		startComponents(stream);
		appendComponent( stream, billon, 0, 1 );
		endComponents(stream);
		close(stream);
	}
示例#2
0
void
Exclude::set(const struct ndn_Exclude& excludeStruct)
{
  clear();
  for (size_t i = 0; i < excludeStruct.nEntries; ++i) {
    ndn_ExcludeEntry *entry = &excludeStruct.entries[i];

    if (entry->type == ndn_Exclude_COMPONENT)
      appendComponent(entry->component.value.value, entry->component.value.length);
    else if (entry->type == ndn_Exclude_ANY)
      appendAny();
    else
      throw runtime_error("unrecognized ndn_ExcludeType");
  }
}
示例#3
0
void
Exclude::set(const ExcludeLite& excludeLite)
{
  clear();
  for (size_t i = 0; i < excludeLite.size(); ++i) {
    const ExcludeLite::Entry& entry = excludeLite.get(i);

    if (entry.getType() == ndn_Exclude_COMPONENT)
      appendComponent(Name::Component(entry.getComponent()));
    else if (entry.getType() == ndn_Exclude_ANY)
      appendAny();
    else
      throw runtime_error("unrecognized ndn_ExcludeType");
  }
}
示例#4
0
	static int objectAppendComponent(lua_State* L)
	{
		luaL_checkany(L, 2);
		auto obj = checkarg<GameObject*>(L, 1);
		auto& comp = checkarg<std::string&>(L, 2);

		std::pair<Component*, bool> result;
		if (lua_gettop(L) == 2 || lua_isnil(L, 3))
		{
			result = obj->appendComponent(comp);
		}
		else
		{
			LuaRef tableRef = LuaRef::fromIndex(L, 3);
			LuaProperties param(tableRef);
			result = obj->appendComponent(comp, param);
		}

		if (!result.first || !result.first->accept(PushComponentVisitor(L)))
			lua_pushnil(L);

		push<bool>(L, result.second);
		return 2;
	}
示例#5
0
 DEPRECATED_IN_NDN_CPP addComponent(uint8_t *component, size_t componentLength)
 {
   return appendComponent(component, componentLength);
 }