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


C++ KeyList类代码示例

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


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

示例1: runGpg

KeyList
BaseG::secretKeys(const QStringList &patterns)
{
    int exitStatus = 0;

    // the option --with-colons should be used for interprocess communication
    // with gpg (according to Werner Koch)
    QCString cmd = "--batch --list-secret-keys --with-fingerprint --with-colons "
                   "--fixed-list-mode";
    for(QStringList::ConstIterator it = patterns.begin();
            it != patterns.end(); ++it)
    {
        cmd += " ";
        cmd += KProcess::quote(*it).local8Bit();
    }
    status = 0;
    exitStatus = runGpg(cmd, 0, true);

    if(exitStatus != 0)
    {
        status = ERROR;
        return KeyList();
    }

    // now we need to parse the output for secret keys
    KeyList secretKeys = parseKeyList(output, true);

    // sort the list of secret keys
    secretKeys.sort();

    return secretKeys;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:32,代码来源:kpgpbaseG.cpp

示例2: parseKeyData

KeyList
BaseG::parseKeyList(const QCString &output, bool secretKeys)
{
    KeyList keys;
    Key *key = 0;
    int offset;

    // search start of key data
    if(!strncmp(output.data(), "pub:", 4)
            || !strncmp(output.data(), "sec:", 4))
        offset = 0;
    else
    {
        if(secretKeys)
            offset = output.find("\nsec:");
        else
            offset = output.find("\npub:");
        if(offset == -1)
            return keys;
        else
            offset++;
    }

    do
    {
        key = parseKeyData(output, offset);
        if(key != 0)
            keys.append(key);
    }
    while(key != 0);

    //kdDebug(5100) << "finished parsing keys" << endl;

    return keys;
}
开发者ID:serghei,项目名称:kde3-kdepim,代码行数:35,代码来源:kpgpbaseG.cpp

示例3: CreateSection

// CreateSection
// Given a section name, this function first checks to see if the given section
// allready exists in the list or not, if not, it creates the new section and
// assigns it the comment given in szComment.  The function returns true if
// sucessfully created, or false otherwise. This version accpets a KeyList
// and sets up the newly created Section with the keys in the list.
bool CDataFile::CreateSection(t_Str szSection, t_Str szComment, KeyList Keys)
{
   if ( !CreateSection(szSection, szComment) )
      return false;

   t_Section* pSection = GetSection(szSection);

   if ( !pSection )
      return false;

   KeyItor k_pos;

   pSection->szName = szSection;
   for (k_pos = Keys.begin(); k_pos != Keys.end(); k_pos++)
      {
         t_Key key;

         key.szComment = (*k_pos).szComment;
         key.szKey     = (*k_pos).szKey;
         key.szValue   = (*k_pos).szValue;

         pSection->Keys.push_back(key);
      }

   m_Sections.push_back(*pSection);
   m_bDirty = true;

   return true;
}
开发者ID:BackupTheBerlios,项目名称:btg-svn,代码行数:35,代码来源:cdatafile.cpp

示例4: CreateSection

// Given a section name, this function first checks to see if the given section
// allready exists in the list or not, if not, it creates the new section and
// assigns it the comment given in mComment.  The function returns true if
// sucessfully created, or false otherwise. This version accpets a KeyList
// and Writes up the newly created Section with the keys in the list.
bool IniFile::CreateSection(const string& Section, const string& Comment, KeyList Keys)
{
	if ( !CreateSection(Section, Comment) )
		return false;

	IniSection* pSection = GetSection(Section);

	if ( !pSection )
		return false;

	KeyItor k_pos;

	pSection->mName = Section;
	for (k_pos = Keys.begin(); k_pos != Keys.end(); k_pos++)
	{
		IniKey* pKey = new IniKey;
		pKey->mComment = (*k_pos)->mComment;
		pKey->mKey = (*k_pos)->mKey;
		pKey->mValue = (*k_pos)->mValue;
		pSection->mKeys.push_back(pKey);
	}

	mSections.push_back(pSection);
	mIsDirty = true;

	return true;
}
开发者ID:Alcibiades586,项目名称:roadrunner,代码行数:32,代码来源:rrIniFile.cpp

示例5: RemoveNotificationKeys

//
// returns number of keys left after removal
//
int plStateChangeNotifier::RemoveNotificationKeys(KeyList keys)
{
    KeyList::iterator it=keys.begin();
    for( ; it != keys.end(); it++)
        IRemoveKey(*it);

    return fKeys.size();
}
开发者ID:H-uru,项目名称:Plasma,代码行数:11,代码来源:plStateChangeNotifier.cpp

示例6: insertTime

void KeyList::insertTime(int tick, int len)
      {
      KeyList tmp;
      for (ciKeyList i = begin(); i != end(); ++i) {
            if ((i->first >= tick) && (tick != 0))
                  tmp[i->first + len] = i->second;
            else
                  tmp[i->first] = i->second;
            }
      clear();
      insert(tmp.begin(), tmp.end());
      }
开发者ID:SSMN,项目名称:MuseScore,代码行数:12,代码来源:key.cpp

示例7: keys

KeyList Serialiser::keys()
{
    Map::iterator iter;
    KeyList k;

    for( iter = values_.begin(); iter != values_.end(); ++iter )
    {
	k.push_back( iter->first );
    }

    return k;
}
开发者ID:michael-stevenson,项目名称:toast,代码行数:12,代码来源:serializer.cpp

示例8: getLinearValue

	Vector getLinearValue( const KeyList &keys,float time )const{
		KeyList::const_iterator next,curr;

		//for( next=keys.begin();next!=keys.end() && time>=next->first;++next ){}
		next=keys.upper_bound( (int)time );

		if( next==keys.begin() ) return next->second.v;
		curr=next;--curr;
		if( next==keys.end() ) return curr->second.v;

		float delta=( time-curr->first )/( next->first-curr->first );
		return ( next->second.v-curr->second.v )*delta+curr->second.v;
	}
开发者ID:Cav098,项目名称:blitz3d,代码行数:13,代码来源:animation.cpp

示例9: numberOfKeyConfigs

/**
 * Abstraction to generalize different kind of keys. 
 * return number of keys _in_a_policy_ 
 * */
int 
numberOfKeyConfigs(const KeyList &policyKeys, const KeyRole role)
{
	const char *scmd = "numberOfKeyConfigs";
	switch (role) {
		case KSK: return policyKeys.ksk_size();
		case ZSK: return policyKeys.zsk_size();
		case CSK: return policyKeys.csk_size();
		default:
			ods_fatal_exit("[%s] %s Unknow Role: (%d)", 
					module_str, scmd, role); /* report a bug! */
	}
}
开发者ID:bbczeuz,项目名称:opendnssec,代码行数:17,代码来源:enforcer.cpp

示例10: getSlerpValue

	Quat getSlerpValue( const KeyList &keys,float time )const{
		KeyList::const_iterator next,curr;

		//for( next=keys.begin();next!=keys.end() && time>=next->first;++next ){}
		next=keys.upper_bound( (int)time );

		if( next==keys.begin() ) return next->second;
		curr=next;--curr;
		if( next==keys.end() ) return curr->second;

		float delta=( time-curr->first )/( next->first-curr->first );
		return curr->second.slerpTo( next->second,delta );
	}
开发者ID:Cav098,项目名称:blitz3d,代码行数:13,代码来源:animation.cpp

示例11: ScaleKey

 void Data::PostLoad(KeyList<ScaleKey> &keys)
 {
   // keys lists must have at least 2 entries
   //
   if (keys.GetCount() == 0)
   {
     keys.Append( new ScaleKey( 0.0f, scale) );
   }
   if (keys.GetCount() == 1)
   {
     keys.Append( new ScaleKey( 1.0f, keys.GetHead()->scale) );
   }
   keys.KeyList<ScaleKey>::PostLoad();
 }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:14,代码来源:effects_utils.cpp

示例12: winSaveKey

void winSaveKey(char *name, KeyList& value)
{
	CString txtKeys;

	POSITION p = value.GetHeadPosition();
	while(p!=NULL)
	{
		CString tmp;
		tmp.Format("%d", value.GetNext(p));
		txtKeys+=tmp;
		if (p!=NULL)
			txtKeys+=",";
	}
	regSetStringValue(name, txtKeys);
}
开发者ID:john-peterson,项目名称:vbam,代码行数:15,代码来源:DirectInput.cpp

示例13: listSubPluginKeys

void LadspaSubPluginFeatures::listSubPluginKeys(
    const Plugin::Descriptor * _desc, KeyList & _kl ) const
{
    Ladspa2LMMS * lm = Engine::getLADSPAManager();

    l_sortable_plugin_t plugins;
    switch( m_type )
    {
    case Plugin::Instrument:
        plugins = lm->getInstruments();
        break;
    case Plugin::Effect:
        plugins = lm->getValidEffects();
        //plugins += lm->getInvalidEffects();
        break;
    case Plugin::Tool:
        plugins = lm->getAnalysisTools();
        break;
    case Plugin::Other:
        plugins = lm->getOthers();
        break;
    default:
        break;
    }

    for( l_sortable_plugin_t::const_iterator it = plugins.begin();
            it != plugins.end(); ++it )
    {
        if( lm->getDescription( ( *it ).second )->inputChannels <=
                Engine::mixer()->audioDev()->channels() )
        {
            _kl.push_back( ladspaKeyToSubPluginKey( _desc, ( *it ).first, ( *it ).second ) );
        }
    }
}
开发者ID:Frankenwolfe,项目名称:lmms,代码行数:35,代码来源:LadspaSubPluginFeatures.cpp

示例14: removeTime

void KeyList::removeTime(int tick, int len)
      {
      KeyList tmp;
      for (ciKeyList i = begin(); i != end(); ++i) {
            if ((i->first >= tick) && (tick != 0)) {
                  if (i->first >= tick + len)
                        tmp[i->first - len] = i->second;
                  else
                        printf("remove key event\n");
                  }
            else
                  tmp[i->first] = i->second;
            }
      clear();
      insert(tmp.begin(), tmp.end());
      }
开发者ID:SSMN,项目名称:MuseScore,代码行数:16,代码来源:key.cpp

示例15: ColorKey

  void Data::PostLoad( KeyList<ColorKey> &keys)
  {
    // keys lists must have at least 2 entries
    //
    if (keys.GetCount() == 0)
    {
      keys.Append( new ColorKey( 0.0f, color.r, color.g, color.b, color.a) );
    }
    if (keys.GetCount() == 1)
    {
      ColorKey *key = keys.GetHead();
      Color c = key->color;

      keys.Append( new ColorKey( 1.0f, c.r, c.g, c.b, c.a) );
    }
    keys.KeyList<ColorKey>::PostLoad();
  }
开发者ID:grasmanek94,项目名称:darkreign2,代码行数:17,代码来源:effects_utils.cpp


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