static int tolua_anysdk_ProtocolShare_share(lua_State* tolua_S) { if (NULL == tolua_S) return 0; int argc = 0; ProtocolShare* self = nullptr; #if COCOS2D_DEBUG >= 1 tolua_Error tolua_err; if (!tolua_isusertype(tolua_S,1,"ccanysdk.ProtocolShare",0,&tolua_err)) goto tolua_lerror; #endif self = static_cast<ProtocolShare*>(tolua_tousertype(tolua_S,1,0)); #if COCOS2D_DEBUG >= 1 if (nullptr == self) { tolua_error(tolua_S,"invalid 'self' in function 'tolua_anysdk_ProtocolShare_share'\n", NULL); return 0; } #endif argc = lua_gettop(tolua_S) - 1; if (1 == argc) { std::map<std::string, std::string> map; luaval_to_stdmap_string_key_string(tolua_S, 2, &map); show_stdmap(&map); self->share(map); return 0; } CCLOG("'share' function of ProtocolShare has wrong number of arguments: %d, was expecting %d\n", argc, 1); return 0; #if COCOS2D_DEBUG >= 1 tolua_lerror: tolua_error(tolua_S,"#ferror in function 'share'.",&tolua_err); return 0; #endif }
void MyShareManager::shareByMode(TShareInfo info, MyShareMode mode) { ProtocolShare* pShare = NULL; switch(mode) { case eTwitter: pShare = s_pTwitter; break; case eWeibo: pShare = s_pWeibo; break; default: break; } if (pShare) { pShare->share(info); } }