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


C++ JID::bareJID方法代码示例

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


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

示例1: subscribe

  void RosterManager::subscribe( const JID& jid, const std::string& name,
                                 const StringList& groups, const std::string& msg )
  {
    if( !jid )
      return;

    add( jid, name, groups );

    Subscription s( Subscription::Subscribe, jid.bareJID(), msg );
    m_parent->send( s );
  }
开发者ID:crazyit,项目名称:iGame,代码行数:11,代码来源:rostermanager.cpp

示例2: main

int main( int /*argc*/, char** /*argv*/ )
{
  int fail = 0;
  std::string name;
  JID j;

  // -------
  name = "bare JID ctor";
  j = JID( "[email protected]" );
  if( j.bare() != "[email protected]" || j.username() != "abc" || j.server() != "server.dom" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "full JID ctor";
  j = JID( "[email protected]/res" );
  if( j.full() != "[email protected]/res" || j.username() != "abc" || j.server() != "server.dom"
      || j.resource() != "res" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "server + resource ctor";
  j = JID( "server.dom/res" );
  if( j.full() != "server.dom/res" || j.server() != "server.dom" || j.resource() != "res" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "server ctor";
  j = JID( "server.dom" );
  if( j.full() != "server.dom" || j.server() != "server.dom" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "prepped node";
  j = JID( "[email protected]" );
  if( j.bare() != "[email protected]" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "prepped dom";
  j = JID( "[email protected]" );
  if( j.bare() != "[email protected]" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "resource getter";
  j = JID( "[email protected]/rEsOurCe" );
  if( j.resource() != "rEsOurCe" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "node getter";
  j = JID( "[email protected]/rEsOurCe" );
  if( j.username() != "abc" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "server getter";
  j = JID( "[email protected]/rEsOurCe" );
  if( j.server() != "server.dom" )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "bare JID getter";
  j = JID( "[email protected]/rEsOurCe" );
  JID t1( "[email protected]/rEsOurCe");
  if( j.bareJID() != t1.bareJID() )
  {
    ++fail;
    fprintf( stderr, "test '%s' failed\n", name.c_str() );
  }

  // -------
  name = "clear jid";
//.........这里部分代码省略.........
开发者ID:PeterXu,项目名称:sipstack,代码行数:101,代码来源:jid_test.cpp

示例3: ackSubscriptionRequest

 void RosterManager::ackSubscriptionRequest( const JID& to, bool ack )
 {
   Subscription p( ack ? Subscription::Subscribed
                                           : Subscription::Unsubscribed, to.bareJID() );
   m_parent->send( p );
 }
开发者ID:crazyit,项目名称:iGame,代码行数:6,代码来源:rostermanager.cpp

示例4: cancel

 void RosterManager::cancel( const JID& jid, const std::string& msg )
 {
   Subscription p( Subscription::Unsubscribed, jid.bareJID(), msg );
   m_parent->send( p );
 }
开发者ID:crazyit,项目名称:iGame,代码行数:5,代码来源:rostermanager.cpp


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