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


C++ writeConfig函数代码示例

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


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

示例1: writeConfig

size_t CLoginDlg::write_data(const char * info)  
{
		
	  Json::Reader reader;
	  Json::Value json_object;
	 // info = "{\"result\": [{\"room_id\": \"7\"}]}";
	  const char* json_document = info;
	  if (!reader.parse(json_document, json_object))
		return 0;
	  Json::Value error_info = json_object["errno"];
	  int errno_s = error_info.asInt();//.asString();
	  if(errno_s == 0)
	  {
		  Json::Value result = json_object["result"];

		  Json::Value::iterator it = result.begin();
		  Json::Value room_id;
		  for(;it!=result.end();it++)
		  {
			  Json::Value allInfo = *it;
			  room_id = allInfo["room_id"];
		  }
		  string s_room_id = room_id.asString();
		  m_room_id = s_room_id.c_str();
		  writeConfig(1,m_room_id,_T(""),_T(""));
		  writeConfig(2,m_room_id,_T(""),_T(""));
		  return 1;
	  }
	  else
	  {
		  return 0;
	  }
}
开发者ID:daijingjing,项目名称:bobo_show_video,代码行数:33,代码来源:LoginDlg.cpp

示例2: getCommConfigPtr

void CommHandler::setParityErrorCheckEnable(bool enable) {
	getCommConfigPtr()->c_iflag =
			enable
			? (INPCK | (getCommConfigPtr()->c_iflag))
			: ((~INPCK) & getCommConfigPtr()->c_iflag);
	writeConfig();
}
开发者ID:morpheby,项目名称:ntc-13.04.5-ui,代码行数:7,代码来源:CommHandler-unix.cpp

示例3: writeMusicSongsConfig

void MusicXMLConfigManager::writeMusicSongsConfig(const MusicSongsList &musics)
{
    if( musics.isEmpty() )
    {
        return;
    }
    //Open wirte file
    if( !writeConfig(MUSICPATH_AL) )
    {
        return;
    }
    ///////////////////////////////////////////////////////
    createProcessingInstruction();
    QDomElement musicPlayer = createRoot("TTKMusicPlayer");
    //Class A
    QDomElement fileNormalPath = writeDomElement(musicPlayer, "fileNormalPath", "count", musics[0].count());
    QDomElement fileLovestPath = writeDomElement(musicPlayer, "fileLovestPath", "count", musics[1].count());
    QDomElement netFilePath = writeDomElement(musicPlayer, "netFilePath", "count", musics[2].count());

    //extend playlist init here
//    for(int i=3; i<fileNamesList.count(); ++i)
//    {
//        QDomElement extend = m_ddom->createElement("extend" + QString::number(i - 2));
//        extend.setAttribute("count",fileNamesList[i].count());
//        TTKMusicPlayer.appendChild(extend);
//    }

    //Class B
    foreach(MusicSong song, musics[0])
    {
        writeDomElementMutilText(fileNormalPath, "value", QStringList() << "name" << "playCount" << "time",
                                 QList<QVariant>() << song.getMusicName() << song.getMusicPlayCount()
                                                   << song.getMusicTime(), song.getMusicPath());
    }
开发者ID:AndyQsmart,项目名称:TTKMusicplayer,代码行数:34,代码来源:musicxmlconfigmanager.cpp

示例4: writeConfig

void ContactEditorMainWindow::slotQuitApp()
{
    if (saveCurrentProject(SaveAndCloseTheme)) {
        writeConfig();
        qApp->quit();
    }
}
开发者ID:KDE,项目名称:kdepim,代码行数:7,代码来源:contacteditormainwindow.cpp

示例5: writeConfig

void JsonTextWriter::writeToStream( const Text & text, std::ostream & os ) {
	os << "{\n\tconfig: ";
	writeConfig( text.getConfig(), os );
	os << ",\n\tcontent: '" << text.getContent() << "',\n\tnodes: [\n\t\t";

	uint nodesCount = text.getNodes().size();
	if ( nodesCount > 0 ) {
		writeNode( *text.getNodes().at( 0 ), os );
		for ( uint i = 1; i < nodesCount; ++ i ) {
			os << ",\n\t\t";
			writeNode( *text.getNodes().at( i ), os );
		}
	}

	os << "\n\t],\n\tannotations: [\n\t\t";

	for ( uint i = 0; i < nodesCount; ++ i ) {
		const Node & node = *text.getNodes().at( i );

		for ( uint j = 0; j < node.getTransitionCount(); ++ j ) {
			if ( i != 0 || j != 0 )
				os << ",\n\t\t";
			writeAnnotation( *node.getTransition( j ), os );
		}
	}

	os << "\n\t]\n}";
}
开发者ID:alesapin,项目名称:lspl,代码行数:28,代码来源:JsonTextWriter.cpp

示例6: wxT

void Mega8Config::saveConfig(const wxString &profile)
{
    if (profile == wxEmptyString) {
        _currentProfile = wxT("General");
    } else {
        _currentProfile = profile;
    }

    saveKeyboard(_currentProfile);
    writeString(wxT("LastFolder"), _LastFolder);

    writeBool(wxT("FullScreen"), _FullScreen);
    writeBool(wxT("SpeedAuto"), _SpeedAuto);
    writeBool(wxT("DisplayHUD"), _DisplayHUD);
    writeBool(wxT("Filtered"), _Filtered);
    writeBool(wxT("SyncClock"), _SyncClock);
    writeLong(wxT("ColorTheme"), (int)_ColorTheme);
    writeBool(wxT("InverseColor"), _InverseColor);
    writeBool(wxT("Sound"), _Sound);
    writeBool(wxT("UseSleep"), _UseSleep);

    for (int i = 0; i <= sizeof(Chip8Types); i++) {
        writeLong(wxT("FrequencyRatio/") + getMachineTypeStr((Chip8Types)i), _FrequencyRatio[i]);
    }

    // Really save config
    if (_config != NULL) {
		writeConfig();
    }
}
开发者ID:Ready4Next,项目名称:Mega8,代码行数:30,代码来源:Mega8Config.cpp

示例7: LOGI

//---------------------------------------------------------------------
// INITIALIZE
//---------------------------------------------------------------------
void PuzzleTV::intialize(bool reset)
{
	LOGI("%s(L=%d)", __func__, __LINE__);
	super::intialize(reset);

	// Clear data
	blockSizeW     = 0;
	blockSizeH     = 0;
	blockW         = 0;
	blockH         = 0;
	blockNum       = 0;
	marginW        = 0;
	marginH        = 0;
	phase          = 0;
	movingBlock    = 0;
	spaceBlock     = 0;
	autoSolveTimer = 0;
	blocks         = NULL;

	// Set default parameters (no clear)
	if (reset) {
		if (readConfig() != CONFIG_SUCCESS) {
			hint = 0;
		}
	} else {
		writeConfig();
	}
}
开发者ID:Johnta,项目名称:EffecTV_for_Android,代码行数:31,代码来源:PuzzleTV.cpp

示例8: QFile

bool OidentdConfigGenerator::init()
{
    _configDir = QDir::homePath();
    _configFileName = ".oidentd.conf";

    if (Quassel::isOptionSet("oidentd-conffile"))
        _configPath = Quassel::optionValue("oidentd-conffile");
    else
        _configPath = _configDir.absoluteFilePath(_configFileName);

    _configTag = " stanza created by Quassel";

    _configFile = new QFile(_configPath);

    // Rx has to match Template in order for cleanup to work.
    // Template should be enhanced with the "from" parameter as soon as Quassel gains
    // the ability to bind to an IP on client sockets.

    _quasselStanzaTemplate = QString("lport %1 { reply \"%2\" } #%3\n");
    _quasselStanzaRx = QRegExp(QString("^lport .* \\{ .* \\} #%1\\r?\\n").arg(_configTag));

    // initially remove all Quassel stanzas that might be present
    if (parseConfig(false) && writeConfig())
        _initialized = true;

    return _initialized;
}
开发者ID:esainane,项目名称:quassel,代码行数:27,代码来源:oidentdconfiggenerator.cpp

示例9: path

bool KPBinaryIface::checkDir(const QString& possibleDir)
{
    bool ret             = false;
    QString possiblePath = path(possibleDir);

    kDebug() << "Testing " << possiblePath << "...";
    QProcess process;
    process.setProcessChannelMode(QProcess::MergedChannels);
    process.start(possiblePath, m_binaryArguments);
    bool val = process.waitForFinished();

    if (val && (process.error() != QProcess::FailedToStart))
    {
        m_isFound = true;

        QString stdOut(process.readAllStandardOutput());

        if (parseHeader(stdOut))
        {
            m_pathDir = possibleDir;
            writeConfig();

            kDebug() << "Found " << path() << " version: " << version();
            ret = true;
        }
        else
        {
            // TODO: do something if the version is not right or not found
        }
    }

    emit signalBinaryValid();
    return ret;
}
开发者ID:rickysarraf,项目名称:digikam,代码行数:34,代码来源:kpbinaryiface.cpp

示例10: writeConfig

void KImportDlg::slotOkClicked()
{
  // Save the used options.
  writeConfig();
  // leave dialog directly
  accept();
}
开发者ID:KDE,项目名称:kmymoney,代码行数:7,代码来源:kimportdlg.cpp

示例11: readConfig

void readConfig(void)
{
    if(had_used_config_file == NULL)
    {
        had_used_config_file = (char*)malloc(1024);
        if(loadConfig(HAD_CONFIG_FILE))
        {
            g_message("Using config %s",HAD_CONFIG_FILE);
            strncpy(had_used_config_file, HAD_CONFIG_FILE,1024);
        }
        else
        {
            if(loadConfig("had.conf"))
            {
                g_message("Using config %s","had.conf");
                strncpy(had_used_config_file, "had.conf",1024);
            }
            else
            {
                g_message("Creating new default config %s","had.conf");
                strncpy(had_used_config_file, "had.conf",1024);
                writeConfig();
            }
        }
    }
    else
    {
        loadConfig(had_used_config_file);
    }
}
开发者ID:elmo2k3,项目名称:had,代码行数:30,代码来源:configfile.c

示例12: applyConfig

void ConfigDialogImpl::slotOk()
{
    applyConfig();
    writeConfig();
    emit(newSettings());
    delete ui;
}
开发者ID:BackupTheBerlios,项目名称:slicker-svn,代码行数:7,代码来源:configdialog_impl.cpp

示例13: myClock

void myClock() {
    int loop=1;
    int h,m,s;
    int color=1, size=1;
    char symbol='X';

    HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
    CONSOLE_SCREEN_BUFFER_INFO consoleInfo;
    WORD saved_attributes;

    GetConsoleScreenBufferInfo(hConsole, &consoleInfo);
    saved_attributes = consoleInfo.wAttributes;

    while(loop) {
        if(GetAsyncKeyState(VK_ESCAPE)) {
            break;
        }
        if(GetAsyncKeyState('C')) {
            writeConfig(color, size, symbol, hConsole, saved_attributes);
            GetAsyncKeyState(VK_SPACE); //Clear
            GetAsyncKeyState('C');//Clear
        }
        readConfig(&color, &size, &symbol);
        initClock(&h,&m,&s);
        char f[17]= {};
        initText(f,h,m,s,symbol);
        system("cls");
        digitalClock(h,m,s);
        printClock(f,color,size,hConsole,saved_attributes);
        sleep(1);
    }
}
开发者ID:spirad14,项目名称:BinaryClock,代码行数:32,代码来源:binaryclock.c

示例14: writeConfig

TPV::~TPV()
{
	applEnding = True;

//	destroyHelp();
	writeConfig();

	if( listWindow )
		{
		deskTop->remove( (TView *)listWindow );
		destroy( (TObject *)listWindow );
		}

	destroy( (TObject *)formDef );
	destroy( (TObject *)aboutDlg );

	remove( clock );
	destroy( clock );

	if( heap )
		{
		remove( heap );
		destroy( heap );
		}
}
开发者ID:jskripsky,项目名称:ancient,代码行数:25,代码来源:PVMIGR.CPP

示例15: writeConfig

bool CMMDVMCal::setTXLevel(int incr)
{
	if (incr > 0 && m_txLevel < 99U) {
		m_txLevel++;
		::fprintf(stdout, "TX Level: %u%%" EOL, m_txLevel);
		return writeConfig();
	}

	if (incr < 0 && m_txLevel > 0U) {
		m_txLevel--;
		::fprintf(stdout, "TX Level: %u%%" EOL, m_txLevel);
		return writeConfig();
	}

	return true;
}
开发者ID:xsystemgr,项目名称:MMDVMCal,代码行数:16,代码来源:MMDVMCal.cpp


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