本文整理汇总了C++中NameValueCollection::GetCount方法的典型用法代码示例。如果您正苦于以下问题:C++ NameValueCollection::GetCount方法的具体用法?C++ NameValueCollection::GetCount怎么用?C++ NameValueCollection::GetCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NameValueCollection
的用法示例。
在下文中一共展示了NameValueCollection::GetCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: name_value_collection___index
int name_value_collection___index(lua_State *L) {
NameValueCollection *collection = GetCollection(L, 1);
const char *name = luaL_checkstring(L, 2);
if (strcmp(name, "Count") == 0) {
lua_pushunsigned(L, collection->GetCount());
} else if (strcmp(name, "AllKeys") == 0) {
StringVectorToLuaArray(L, collection->AllKeys());
} else if (strcmp(name, "Add") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_Add, 1);
} else if (strcmp(name, "Get") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_Get, 1);
} else if (strcmp(name, "GetKey") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_GetKey, 1);
} else if (strcmp(name, "GetValues") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_GetValues, 1);
} else if (strcmp(name, "Clear") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_Clear, 1);
} else if (strcmp(name, "Set") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_Set, 1);
} else if (strcmp(name, "Remove") == 0) {
lua_pushlightuserdata(L, (void *)collection);
lua_pushcclosure(L, name_value_collection_Remove, 1);
} else {
lua_pushstring(L, "Unknown property or method.");
lua_error(L);
}
return 1;
}