亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? genericvalues.c

?? 機器足球2D比賽程序 對trlen_base_2002的改進
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*! Get method for the 'm_iValuesTotal' member variable.    \return the total number of generic values stored in the collection so far*/int GenericValues::getValuesTotal( ){  return ( m_iValuesTotal );}/*! This method adds a new generic value to the collection and provides a    connection between a string name and the variable name of the generic value.    \param strName a string denoting the name associated with the variable of    the generic value which is added (the variable can be reached through this    name)    \param vAddress a (void) pointer to the actual variable itself    \param type the (generic) type of the variable which is added    \return a boolean indicating whether the generic value has been succesfully    added */bool GenericValues::addSetting( const char *strName, void *vAddress,                                                     GenericValueKind type ){  if( getValuePtr( strName ) )               // setting already installed  {    cerr << "Setting '" << strName << "' already installed." << endl;    return false;  }  if( m_iValuesTotal == m_iMaxGenericValues )    // buffer is full  {    cerr << "GenericValues::addSetting buffer for " << m_strClassName <<            " is full (cannot add '" << strName << "')" << endl;    return false;  }  m_values[ m_iValuesTotal++ ] = new GenericValueT( strName, vAddress, type );  return ( true );}/*! This (private) method returns a pointer to the GenericValueT object of which    the name associated with the variable matches the argument passed to the    method.    \param strName a string denoting the name associated with the variable of    the GenericValueT object to which a pointer should be returned    \return a pointer to the GenericValueT object of which the name associated    with the variable matches the argument; 0 when a GenericValueT object with a    variable associated with the given name does not exist */GenericValueT* GenericValues::getValuePtr( const char *strName ){  GenericValueT *ptr = 0;  // search through the collection for a GenericValueT object of which the name  // associated with the variable matches the argument passed to the method  for( int i = 0 ; i < getValuesTotal( ) ; i++ )  {    if( strcmp( m_values[ i ]->getName( ), strName ) == 0 )    {      ptr = m_values[ i ];      break;    }  }  return ( ptr );}/*! This method determines the value of the variable of which the name    associated with it matches the first argument to the method. The value is    converted to a string which is put into the second argument (note that    enough memory must be allocated for this char*). This same string is also    returned by the method. This enables you to use the method as an argument    to a function such as 'strcpy'.    \param strName a string denoting the name associated with the variable of    which the value should be returned    \param strValue a string which after the method call will contain the value    of the variable of which the name associated with it matches the first    argument to the method    \return a string containing the value of the variable of which the name    associated with it matches the first argument to the method */char* GenericValues::getValue( const char *strName, char *strValue ){  GenericValueT *parptr;  parptr = getValuePtr( strName );  if( parptr )    strValue = parptr->getValue( strValue );   // this method returns a string  else    strValue[ 0 ] = '\0';  return ( strValue );}/*! This method sets the variable of which the name associated with it matches    the first argument to the method to the value indicated by the second    argument. The value is always supplied as a string which is then converted    into the right type for the generic value in question.    \param strName a string denoting the name associated with the variable which    must be set    \param strValue a string denoting the value to which the variable indicated    by the first argument should be set    \return a boolean indicating whether the update was successful */bool GenericValues::setValue( const char *strName, const char *strValue ){  bool bReturn = false;  GenericValueT *parptr;  parptr = getValuePtr( strName );  if( parptr )    bReturn = parptr->setValue( strValue ); // string is converted to right type  return ( bReturn );}/*! This method reads generic values from a file indicated by the first argument    to the method and stores them in the collection. In this file the names    associated with each value must be listed first followed by a separator and    then the value. The names associated with each value should match the string    names with which the corresponding generic value is added using    'addSetting'.    \param strFile a string denoting the name of the file from which the values    must be read    \param strSeparator a string representing the separator which is written    between name and value in the configuration file    \return a boolean indicating whether the values have been read correctly */bool GenericValues::readValues( const char *strFile, const char *strSeparator ){  ifstream in( strFile );  if( !in )  {    cerr << "(GenericValues::readValues) Could not open file '" <<    strFile << "'" << endl;    return ( false );  }  bool  bReturn = true;  char  strLine[ 256 ], strName[ 100 ], strValue[ 100 ];  char* c;  int   iLineNr = 0;  // read each line in the configuration file and store the values  while( in.getline( strLine, sizeof( strLine ) ) )  {    iLineNr++;    // skip comment lines and empty lines; " #" is for server.conf version 7.xx    if( !( strLine[ 0 ] == '\n' ||           strLine[ 0 ] == '#'  ||           strLine[ 0 ] == '\0' ||           ( strlen( strLine ) > 1 &&             strLine[ 0 ] == ' ' &&             strLine[ 1 ] == '#' ) ) )    {      // convert all characters belonging to the separator to spaces      if( strSeparator && ( c = strstr( strLine, strSeparator ) ) != NULL )        for( size_t i = 0; i < strlen( strSeparator ); i++ )          *( c + i ) = ' ';      // read the name and value on this line and store the value      if( !( sscanf( strLine, "%s%s", strName, strValue ) == 2 &&             setValue( strName, strValue ) ) )      {        bReturn = false;        cerr << "(GenericValues::readValues) '" << strFile << "' linenr "             << iLineNr << ",  error in '" << strLine << "'" << endl;      }    }  }  return ( bReturn );}/*! This method writes the generic values in the current collection to a file    indicated by the first argument to the method. The string name associated    with the value and the value itself are separated by a separator which is    specified as the second argument.    \param strFile a string denoting the name of the file to which the generic    values should be written    \param strSeparator a string representing the separator which should be    written between the name associated with each value and the value itself    \param bAppend a boolean indicating whether the values should be appended to    the given file (=true) or if current contents of the file should be    overwritten (=false)    \return a boolean indicating whether the values in the current collection    have been correctly written to the given file */bool GenericValues::saveValues( const char *strFile, const char *strSeparator,                                bool bAppend ){  ofstream outf( strFile, ( bAppend == false ? ( ios::out )                                             : ( ios::out | ios::app ) ) );  if( !outf )  {    cerr << "Could not open file '" << strFile << "'" << endl;    return ( false );  }  // values are written to file using 'show' (note that  // output stream to write to is a file in this case)  show( outf, strSeparator );  return ( true );}/*! This display method writes all the generic values in the current collection    to the output stream indicated by the first argument to the method. The name    associated with each value and the value itself are separated by a separator    which is specified as the second argument.    \param out the output stream to which the current collection of generic    values should be written    \param strSeparator a string representing the separator which should be    written between the name associated with each value and the value itself */void GenericValues::show( ostream& out, const char *strSeparator ){  for( int i = 0; i < getValuesTotal( ); i++ )    m_values[ i ]->show( out, strSeparator );}/********************** TESTING PURPOSES **************************************//*int main( void ){  GenericValues g;  int    i = 10;  char*  c = "hallo";  bool   b = true;  double d = 10.14;  cout << g.addSetting( "var1", &i, GENERIC_VALUE_INTEGER ) << endl;  cout << g.addSetting( "var2", &c, GENERIC_VALUE_STRING  ) << endl;  cout << g.addSetting( "var3", &d, GENERIC_VALUE_DOUBLE  ) << endl;  cout << g.addSetting( "var4", &b, GENERIC_VALUE_BOOLEAN ) << endl;  g.show( cout );  g.setValue( "var1", "11"      );  g.setValue( "var2", "hoi"     );  g.setValue( "var3", "20.2342" );  g.setValue( "var4", "false"   );  g.show( cout );  g.setIntegerValue( "var1", 22      );  g.setStringValue ( "var2", "hoi2"  );  g.setDoubleValue ( "var3", 30.2342 );  g.setBooleanValue( "var4", true    );  g.show( cout );  g.readValues( "server.conf", ":" );  g.show( cout );  return ( 0 );}*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日日噜噜夜夜狠狠视频欧美人| 成人avav影音| 成人自拍视频在线观看| 欧美综合在线视频| 国产午夜精品福利| 视频在线观看一区二区三区| 成人精品国产一区二区4080| 日韩一级成人av| 亚洲欧美日韩国产另类专区| 国产精品一二三在| 337p亚洲精品色噜噜狠狠| 亚洲免费色视频| 国产91丝袜在线18| 26uuu久久天堂性欧美| 视频一区二区中文字幕| 在线亚洲精品福利网址导航| 国产亚洲欧美一区在线观看| 免费视频最近日韩| 欧美日韩国产电影| 亚洲最新视频在线播放| 91亚洲男人天堂| 中文av一区特黄| 国产91精品入口| 久久精品日产第一区二区三区高清版| 亚洲成av人片| 欧美美女视频在线观看| 一级日本不卡的影视| 91免费观看国产| 国产精品美女久久久久久久久| 国产高清精品久久久久| 精品国产乱子伦一区| 国产在线视频精品一区| 日韩免费观看高清完整版在线观看| 偷偷要91色婷婷| 欧美日韩aaaaaa| 日本亚洲最大的色成网站www| 欧美日韩精品福利| 亚洲成在人线在线播放| 欧美日韩黄视频| 日本不卡一二三区黄网| 欧美成人三级在线| 国产一区二区不卡在线| 国产欧美日韩麻豆91| 成人听书哪个软件好| 欧美韩国日本一区| 色综合视频在线观看| 一区二区三区精品在线| 欧美日韩精品电影| 国内精品久久久久影院色| 欧美国产日本视频| 91激情五月电影| 午夜精品一区二区三区免费视频 | 91精品欧美福利在线观看| 性做久久久久久久久| 欧美成人三级电影在线| 成人黄色777网| 亚洲午夜视频在线观看| 日韩一区二区三区视频在线观看| 韩国在线一区二区| 中文字幕色av一区二区三区| 欧美系列在线观看| 国内精品免费**视频| 亚洲欧美偷拍三级| 日韩视频免费直播| 99久久婷婷国产综合精品| 亚洲h精品动漫在线观看| 久久久蜜臀国产一区二区| 不卡一区二区三区四区| 亚洲成人激情av| 国产欧美综合在线| 欧美日产国产精品| 成人小视频免费观看| 亚洲成人一区二区| 亚洲国产精品国自产拍av| 欧美精品黑人性xxxx| 国产99精品国产| 日韩**一区毛片| 亚洲色图视频网站| 久久综合网色—综合色88| 欧美艳星brazzers| 国产成人免费av在线| 视频一区二区三区入口| 日韩久久一区二区| 久久久久97国产精华液好用吗| 在线看国产一区二区| 国产a视频精品免费观看| 日韩一区欧美二区| 亚洲精品中文在线| 国产精品网站在线观看| 日韩美一区二区三区| 欧美怡红院视频| 99免费精品在线观看| 黑人巨大精品欧美黑白配亚洲| 亚洲午夜三级在线| 国产精品国产精品国产专区不蜜 | 亚洲欧美另类小说| 久久久精品天堂| 欧美精品123区| 91麻豆免费看| 99国产一区二区三精品乱码| 国产一区二区久久| 国产一区二区在线电影| 免费在线一区观看| 青青草97国产精品免费观看| 亚洲.国产.中文慕字在线| 亚洲乱码日产精品bd| 国产精品传媒入口麻豆| 国产精品久久久久国产精品日日| 久久精品一区二区三区不卡 | 国产高清不卡二三区| 精品中文av资源站在线观看| 日本亚洲一区二区| 美女在线观看视频一区二区| 视频一区在线视频| 日韩成人一级大片| 免费看黄色91| 狠狠v欧美v日韩v亚洲ⅴ| 国产精品亚洲午夜一区二区三区| 麻豆freexxxx性91精品| 精品无码三级在线观看视频| 久久99精品国产.久久久久| 国产在线观看一区二区 | 麻豆成人综合网| 久久99久久99| 国产一区二区久久| 成人爱爱电影网址| 色哟哟精品一区| 欧美日韩亚洲综合一区二区三区| 欧美日韩免费电影| 日韩一级二级三级精品视频| 欧美精品一区二区久久久| 久久综合九色综合久久久精品综合| xvideos.蜜桃一区二区| 国产精品视频麻豆| 一区二区三区美女视频| 男人的天堂亚洲一区| 极品少妇xxxx精品少妇| 成人毛片视频在线观看| 日本高清不卡aⅴ免费网站| 欧美日韩黄色一区二区| 2017欧美狠狠色| 亚洲欧洲性图库| 日韩国产成人精品| 国产丶欧美丶日本不卡视频| 色综合久久88色综合天天免费| 欧美精品粉嫩高潮一区二区| 久久久久久夜精品精品免费| 亚洲天堂精品在线观看| 日韩精品一级中文字幕精品视频免费观看 | 91色.com| 欧美一区二区三区四区视频| 国产日韩欧美综合在线| 亚洲在线一区二区三区| 麻豆精品久久久| 色综合视频一区二区三区高清| 91精品国产aⅴ一区二区| 国产欧美精品区一区二区三区| 亚洲免费观看高清完整版在线| 奇米精品一区二区三区在线观看 | 久久99精品国产麻豆婷婷洗澡| 不卡电影免费在线播放一区| 欧美欧美欧美欧美首页| 国产人久久人人人人爽| 天天综合色天天| 北岛玲一区二区三区四区| 欧美一级淫片007| 亚洲欧美偷拍三级| 国产成人精品影视| 欧美高清www午色夜在线视频| 国产精品理伦片| 国产精品综合二区| 91精品国产欧美日韩| 亚洲综合一区二区精品导航| 国产电影精品久久禁18| 日韩一区国产二区欧美三区| 亚洲精品成人天堂一二三| 国产精品一二三四| 欧美成人一区二区三区在线观看| 一区二区三区在线观看视频| 懂色av一区二区夜夜嗨| 欧美成人三级电影在线| 天天色 色综合| 欧美三区在线观看| 亚洲精品乱码久久久久久久久| 国产一本一道久久香蕉| 精品乱人伦一区二区三区| 婷婷开心激情综合| 欧美怡红院视频| 亚洲综合丝袜美腿| 色综合久久中文字幕综合网| 亚洲欧洲精品一区二区精品久久久| 国产精品1区2区| 2021久久国产精品不只是精品| 精品亚洲成av人在线观看| 日韩欧美中文字幕精品| 毛片av中文字幕一区二区| 日韩欧美不卡在线观看视频| 久久精品国产一区二区三区免费看| 欧美精品在线观看播放| 日日摸夜夜添夜夜添精品视频|