• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ UserList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中UserList的典型用法代码示例。如果您正苦于以下问题:C++ UserList类的具体用法?C++ UserList怎么用?C++ UserList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: saveUserFile

void IoHandler::saveUserFile(string userFile, UserList &userList)
{
	ofstream outputFile;

	outputFile.open(userFile);

	if (outputFile.fail())
	{
		cout << "파일을 찾을수 없습니다.";
		return;
	}

	for (int i = 0; i < userList.getSize(); ++i)
	{
		outputFile << "[" << userList.getUserByIndex(i).getName() << "]" << " ";
		outputFile << "[" << userList.getUserByIndex(i).getWinCount() << "]" << " ";
		outputFile << "[" << userList.getUserByIndex(i).getLoseCount() << "]";
		if (i != userList.getSize() - 1)
		{
			outputFile << endl;
		}
	}

	outputFile.close();
}
开发者ID:LeeSeongDong,项目名称:ProgramingHomework,代码行数:25,代码来源:IoHandler.cpp


示例2: kdebugf

bool KaduExtInfo::getSelectedUser(QString &user)
{
    kdebugf();
#if defined(KADU_0_4_x)
    UserBox *activeUserBox = kadu->userbox()->getActiveUserBox();
#elif defined(KADU_0_5_0)
    UserBox *activeUserBox = kadu->userbox()->activeUserBox();
#endif
    if (activeUserBox == NULL)//to siê zdarza...
    {
        kdebugf2();
        return false;
    }
#if defined(KADU_0_4_x)
    UserList users = activeUserBox->getSelectedUsers();
#elif defined(KADU_0_5_0)
    UserListElements users = activeUserBox->selectedUsers();
#endif
    if (users.count() == 1)
    {
        user = (*users.begin()).altNick();
        kdebugf2();
        return true;
    }
    return false;
    kdebugf2();
}
开发者ID:BackupTheBerlios,项目名称:kadu-ext-info,代码行数:27,代码来源:ext_general.cpp


示例3: SystemName

int GeUser::modify_user(char* system, char* user, char* password,
    unsigned int priv, char* fullname, char* description, char* email,
    char* phone, char* sms)
{
  int sts;
  UserList* ul;

  SystemName* sn = new SystemName(system);
  sts = sn->parse();
  if (EVEN(sts)) {
    delete sn;
    return sts;
  }

  SystemList* sl = find_system(sn);
  delete sn;
  if (!sl)
    return USER__NOSUCHSYSTEM;

  ul = (UserList*)sl->find_user(user);
  if (!ul)
    return USER__NOSUCHUSER;
  ul->modify(password, priv, fullname, description, email, phone, sms);

  return USER__SUCCESS;
}
开发者ID:siamect,项目名称:proview,代码行数:26,代码来源:co_user.cpp


示例4: users

void Element::setUsers( UserList ul )
{
	if (!isRecord())
		return;

	UserList toAdd;
	UserList toRemove;

	UserList currentUsers = users();

	foreach( User emp, ul )
		if( !currentUsers.contains( emp ) )
			toAdd += emp;

	foreach( User eu, currentUsers )
		if( !ul.contains( eu ) )
			toRemove += eu;

	ElementUserList tul = ElementUser::recordsByElement( *this );
	foreach( ElementUser eu, tul )
		if( toRemove.contains( eu.user() ) )
			eu.remove();

	foreach( User emp, toAdd )
	{
		ElementUser tu;
		tu.setElement( *this );
		tu.setUser( emp );
		tu.setActive( 1 );
		tu.commit();
	}
开发者ID:kurikaesu,项目名称:arsenalsuite,代码行数:31,代码来源:elementbase.cpp


示例5: getCurrentdUser

LRESULT WaitingUsersFrame::onRemove(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
	if (getSelectedUser())
	{
		const UserPtr User = getCurrentdUser();
		if (User)
		{
			UploadManager::LockInstanceQueue lockedInstance; // [+] IRainman opt.
			lockedInstance->clearUserFilesL(User);
		}
	}
	else
	{
		if (m_ctrlList.getSelectedCount())
		{
			int j = -1;
			UserList RemoveUsers;
			while ((j = m_ctrlList.GetNextItem(j, LVNI_SELECTED)) != -1)
			{
				// Ok let's cheat here, if you try to remove more users here is not working :(
				RemoveUsers.push_back((m_ctrlList.getItemData(j))->getUser());
			}
			UploadManager::LockInstanceQueue lockedInstance; // [+] IRainman opt.
			for (auto i = RemoveUsers.cbegin(); i != RemoveUsers.cend(); ++i)
			{
				lockedInstance->clearUserFilesL(*i);
			}
		}
	}
	m_needsUpdateStatus = true; // [!] IRainman opt.
	return 0;
}
开发者ID:,项目名称:,代码行数:32,代码来源:


示例6: GetV6Chat3App

int LuaV6Chat3App::ChatWithText(lua_State *luaState)
{
	V6Chat3App *App = GetV6Chat3App(luaState);
	if (App)
	{
		lua_Integer uid = lua_tointeger(luaState, 2);

		size_t text_len=lua_objlen(luaState, 3);
		const char *text = lua_tolstring(luaState, 3, &text_len);

		wstring wtext = V6Util::Utf8ToUnicode(text);
		string st;

		UserList *list = UserList::Instance();
		list->RecordChatText(uid, wtext, st);
		Handle<MsgSender> sender;
		list->GetUserSender(uid, sender);
		sender->ChatWithTextMsg(wtext, st);

		lua_pushstring(luaState, st.c_str());
		return 1;
	}

	lua_pushnil(luaState);
	return 1;
}
开发者ID:wuyingfengsui,项目名称:V6Chat,代码行数:26,代码来源:LuaV6Chat3App.cpp


示例7: Update

STATE StateNetwork::Update()
{
	if(m_pNetworkControler && (m_pNetworkControler->GetNetworkState() == CLIENT))
	{
		m_pNetworkControler->ReceivePacket();

		SmartPointer<PacketAddr> pAddr;
		if((pAddr = m_pNetworkControler->GetPacket()) != NULL)
		{
			if( pAddr->m_Packet.Protocolid() == CONNECT_REQ)
			{
				UserInfomationPacketMaker pkMaker;
				pkMaker.SetPacket(&pAddr->m_Packet);
				UserList lst = pkMaker.OutPutUserInformation();
				UserList::iterator iter;
				for(iter = lst.begin(); iter != lst.end(); iter++)
				{
					//여기에다가 이미 존재하는 유져가 있을경우 AddUser를 호출하지 않게 만들어야 함...
					m_pNetworkControler->AddUser((*iter));
					delete (*iter);
				}
				lst.clear();

				m_pNetworkControler->SetMyUserID(pAddr->m_Packet.ID());
				return STATE_WAITINGROOM;
			}
		}
	}

	if(m_bSelectState)
		return STATE_WAITINGROOM;
	else
		return STATE_NONE;
}
开发者ID:JeongSeungSU,项目名称:FightingSprit,代码行数:34,代码来源:StateNetwork.cpp


示例8: getUserList

//向客户端发送所有的用户信息
void getUserList(sockaddr_in sender)
{
	int len = (int)clientList.size();
	sendto(primarySock,(const char *)&len,sizeof(len),0,(SOCKADDR *)&sender,sizeof(sender));
	for(UserList::iterator UserIterator = clientList.begin(); UserIterator != clientList.end(); ++UserIterator)
	{
		sendto(primarySock,(const char *)(*UserIterator),sizeof(stUserListNode),0,(SOCKADDR *)&sender,sizeof(sender));
	}
}
开发者ID:qhw,项目名称:udp_nat,代码行数:10,代码来源:socketserver.cpp


示例9: getFromWebService

User *
Query::getUserByName(const string &name)
{
	Metadata *metadata = getFromWebService("user", "", NULL, &UserFilter().name(name));
	UserList list = metadata->getUserList(true);
	delete metadata;
	if (list.size() > 0) 
		return list[0];
	else
		throw ResponseError("response didn't contain user data");
}
开发者ID:Seltzer,项目名称:foo-bulk-tagger,代码行数:11,代码来源:query.cpp


示例10: GetUser

stUserListNode GetUser(char *username)
{
	for(UserList::iterator UserIterator=ClientList.begin();
						UserIterator!=ClientList.end();
							++UserIterator)
	{
		if( strcmp( ((*UserIterator)->userName), username) == 0 )
			return *(*UserIterator);
	}
	throw Exception("not find this user");
}
开发者ID:hiccupzhu,项目名称:misc_starting,代码行数:11,代码来源:P2PServer.cpp


示例11: GetUser

stUserListNode GetUser(char *userName)
{
	for (auto ClientList_iter = ClientList.begin(); ClientList_iter != ClientList.end(); ++ClientList_iter)
	{
		if (strcmp((*ClientList_iter)->userName, userName) == 0)
			return *(*ClientList_iter);
	}
	
	std::cout << "can not find user: " << userName << std::endl;

	exit(0);
}
开发者ID:MacroGu,项目名称:p2p_comm,代码行数:12,代码来源:p2p_server.cpp


示例12: removeSelected

void UploadQueueFrame::removeSelected() {
	int i = -1;
	UserList RemoveUsers;
	while((i = ctrlList.GetNextItem(i, LVNI_SELECTED)) != -1) {
		// Ok let's cheat here, if you try to remove more users here is not working :(
		RemoveUsers.push_back(((UploadQueueItem*)ctrlList.getItemData(i))->getUser());
	}
	for(auto i = RemoveUsers.begin(); i != RemoveUsers.end(); ++i) {
		UploadManager::getInstance()->clearUserFiles(*i, true);
	}
	updateStatus();
}
开发者ID:,项目名称:,代码行数:12,代码来源:


示例13: processRemoveFromListEvent

void TabUserLists::processRemoveFromListEvent(const Event_RemoveFromList &event)
{
    QString list = QString::fromStdString(event.list_name());
    QString user = QString::fromStdString(event.user_name());
    UserList *userList = 0;
    if (list == "buddy")
        userList = buddyList;
    else if (list == "ignore")
        userList = ignoreList;
    if (!userList)
        return;
    userList->deleteUser(user);
}
开发者ID:Cockatrice,项目名称:Cockatrice,代码行数:13,代码来源:tab_userlists.cpp


示例14: removeUser

void removeUser(char *name)
{
	stUserListNode *removeNode;
	
	removeNode = getUser(name);
	clientList.remove(removeNode);
	for(UserList::iterator UserIterator = clientList.begin(); UserIterator != clientList.end(); ++UserIterator)
	{
		stUserListNode *tmpNode = (stUserListNode *)(*UserIterator);
		u_long ip = htonl(tmpNode->ip);
		cout << "username :" << tmpNode->stUserName <<" ip:"<<inet_ntoa(*(in_addr *)&ip) <<" port:"<<tmpNode->port <<endl;
	}
}
开发者ID:qhw,项目名称:udp_nat,代码行数:13,代码来源:socketserver.cpp


示例15: calloc

void rt_pvd_udb::load_systemgroup( SystemList *systemgroup)
{
  procom_obj item;
  pwr_sClass_SystemGroupReg *body;
  char sname[120];
  char *s;

  body = (pwr_sClass_SystemGroupReg *) calloc( 1, sizeof(pwr_sClass_SystemGroupReg));
  item.body = body;
  gu->get_system_name( systemgroup, sname);
  if (( s = strrchr( sname, '.')))
    strcpy( item.name, s+1);
  else
    strcpy( item.name, sname);

  gu->get_system_data( sname, &body->Attributes, &item.oix, body->Description);
  item.oix++;

  if ( next_oix <= item.oix)
    next_oix = item.oix + 1;
  item.cid = pwr_cClass_SystemGroupReg;
  item.fthoix = menu_stack[menu_cnt - 1];
  item.bwsoix = m_list[item.fthoix].lchoix;
  if ( item.bwsoix)
    m_list[item.bwsoix].fwsoix = item.oix;
  if ( m_list[item.fthoix].fchoix == 0)
    m_list[item.fthoix].fchoix = item.oix;
  m_list[item.fthoix].lchoix = item.oix;

  item.body_size = sizeof(pwr_sClass_SystemGroupReg);

  menu_stack[menu_cnt] = item.oix;
  menu_cnt++;
  if ( m_list.size() <= item.oix + 1)
    m_list.resize( item.oix + 1);
  m_list[item.oix] = item;

  UserList *user = systemgroup->first_user();
  while ( user) {
    load_user( user, systemgroup);

    user = user->next_user();
  }
  SystemList *sg = systemgroup->first_system();
  while ( sg) {
    load_systemgroup( sg);

    sg = sg->next_system();
  }
  menu_cnt--;
}
开发者ID:Strongc,项目名称:proview,代码行数:51,代码来源:rt_pvd_udb.cpp


示例16: cdh_ToLower

int GeUser::get_user( const char *gu_system, const char *gu_user, const char *gu_password, 
		      unsigned int *priv)
{
  UserList *ul;
  SystemList *sl;
  SystemName *sn, *parent;
  int sts;
  char system[80];
  char password[80];
  char user[80];

  cdh_ToLower( system, gu_system);
  cdh_ToLower( user, gu_user);
  strcpy( password, gu_password);

  // Find system
  sn = new SystemName( system);
  sts = sn->parse();
  if ( EVEN(sts))
  {
    delete sn;
    return USER__NOSUCHSYSTEM;
  }

  while( sn)
  {
    sl = find_system( sn);
    if ( sl)
    {
      ul = (UserList *) sl->find_user( user);
      if ( ul)
      {
        sts = ul->check_password( password);
        if ( EVEN(sts))
          return sts;
        *priv = ul->priv;
        return USER__SUCCESS;
      }
      if ( !(sl->attributes & user_mSystemAttr_UserInherit))
        break;
    }
    parent = sn->parent();
    if ( parent)
      parent->parse();
    delete sn;
    sn = parent;
  }
  return USER__NOSUCHUSER;
}
开发者ID:jordibrus,项目名称:proview,代码行数:49,代码来源:co_user.cpp


示例17: getUser

stUserListNode* getUser(char *name)
{
	stUserListNode *node = NULL;
	stUserListNode *removeNode = NULL;
	for(UserList::iterator UserIterator = clientList.begin(); UserIterator != clientList.end(); ++UserIterator)
	{
		node = (stUserListNode *)(*UserIterator);
		if(strcmp(node->stUserName,name) == 0)
		{
			removeNode = node;
			break;
		}
	}
	return removeNode;
}
开发者ID:qhw,项目名称:udp_nat,代码行数:15,代码来源:socketserver.cpp


示例18: ParseActiveUsersResponseStanza

bool XmppStanzaParser::ParseActiveUsersResponseStanza(XmppStanzaPtr stanza, UserList& userList)
{
    bool result = false;
    if (IsActiveUsersResponseStanza(stanza))
    {
        XmppStanzaPtr query = stanza->GetChildByName(stanza_names::Query);
        if (!!query)
        {
            for (XmppStanzaPtr item = query->GetFirstChild(); !!item; item = item->GetNextChild())
            {
                User user;
                user.identifier = item->GetAttribute(stanza_attribute_keys::Jid);
                
                std::string base64PubKey = item->GetAttribute(stanza_attribute_keys::Key);
                if (!base64PubKey.empty())
                {
                    user.securityPolicy.encryptionAlgo = encryption_algorithm::RSA_1024; // TODO: receive algo from server
                    user.securityPolicy.encryptionPubKey = detail::Base64::Decode(base64PubKey);
                }
                
                userList.push_back(user);
            }
        }
        
        result = true;
    }
    return result;
}
开发者ID:1Project,项目名称:SafeBoardMessenger,代码行数:28,代码来源:xmpp_stanza_parser.cpp


示例19: processAddToListEvent

void TabUserLists::processAddToListEvent(const Event_AddToList &event)
{
    const ServerInfo_User &info = event.user_info();
    bool online = allUsersList->getUsers().contains(QString::fromStdString(info.name()));
    QString list = QString::fromStdString(event.list_name());
    UserList *userList = 0;
    if (list == "buddy")
        userList = buddyList;
    else if (list == "ignore")
        userList = ignoreList;
    if (!userList)
        return;

    userList->processUserInfo(info, online);
    userList->sortItems();
}
开发者ID:Cockatrice,项目名称:Cockatrice,代码行数:16,代码来源:tab_userlists.cpp


示例20: int

void SystemList::save(std::ofstream& fp)
{
  UserList* ul;
  SystemList* sl;

  fp << int(user_eData_System) << '\n';
  fp << int(user_eData_SystemName) << FSPACE << name << '\n';
  fp << int(user_eData_SystemLevel) << FSPACE << level << '\n';
  fp << int(user_eData_SystemAttributes) << FSPACE << attributes << '\n';
  fp << int(user_eData_SystemId) << FSPACE << id << '\n';
  fp << int(user_eData_SystemDescription) << FSPACE << description << '\n';
  for (ul = (UserList*)userlist; ul != NULL; ul = ul->next)
    ul->save(fp);
  for (sl = childlist; sl; sl = sl->next)
    sl->save(fp);
  fp << int(user_eData_End) << '\n';
}
开发者ID:siamect,项目名称:proview,代码行数:17,代码来源:co_user.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ UserManager类代码示例发布时间:2022-05-31
下一篇:
C++ UserInterface类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap