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

C++ GetConfigPath函数代码示例

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

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



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

示例1: TryDetectNonSysInPlaceEncSettings

// Returns the number of partitions where non-system in-place encryption is progress or had been in progress
// but was interrupted. In addition, via the passed pointer, returns the last selected wipe algorithm ID.
// nee int LoadNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm)
int TryDetectNonSysInPlaceEncSettings (WipeAlgorithmId *wipeAlgorithm)
{
	char *fileBuf = NULL;
	char *fileBuf2 = NULL;
	DWORD size, size2;
	int count;

	*wipeAlgorithm = TC_WIPE_NONE;

	if (!FileExists (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC)))
		return 0;

	if ((fileBuf = LoadFile (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC), &size)) == NULL)
		return 0;

	if (FileExists (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE)))
	{
		if ((fileBuf2 = LoadFile (GetConfigPath (TC_APPD_FILENAME_NONSYS_INPLACE_ENC_WIPE), &size2)) != NULL)
			*wipeAlgorithm = (WipeAlgorithmId) atoi (fileBuf2);
	}

	count = atoi (fileBuf);

	if (fileBuf != NULL)
		TCfree (fileBuf);

	if (fileBuf2 != NULL)
		TCfree (fileBuf2);

	return (count);
}
开发者ID:nicnilov,项目名称:truecrypt-api,代码行数:34,代码来源:Options.c


示例2: GetOptionsDB

void ServerConnectWnd::OkClicked()
{
    // record selected galaxy setup options as new defaults
    GetOptionsDB().Set("multiplayersetup.player-name",  m_player_name_edit->Text());
    GetOptionsDB().Set("multiplayersetup.host-address", m_IP_address_edit->Text());

    // Save the changes:
    {
        boost::filesystem::ofstream ofs(GetConfigPath());
        if (ofs) {
            GetOptionsDB().GetXML().WriteDoc(ofs);
        } else {
            std::cerr << UserString("UNABLE_TO_WRITE_CONFIG_XML") << std::endl;
            std::cerr << GetConfigPath().string() << std::endl;
            Logger().errorStream() << UserString("UNABLE_TO_WRITE_CONFIG_XML");
            Logger().errorStream() << GetConfigPath().string();
        }
    }

    m_result.first = *m_player_name_edit;
    if (m_host_or_join_radio_group->CheckedButton() == 0) {
        m_result.second = "HOST GAME SELECTED";
    } else {
        m_result.second = *m_IP_address_edit;
        if (m_result.second == "") {
            m_result.second =
                boost::polymorphic_downcast<GG::TextControl*>(
                    (***m_servers_lb->Selections().begin())[0])->Text();
        }
    }
    CUIWnd::CloseClicked();
}
开发者ID:fatman2021,项目名称:FreeOrion,代码行数:32,代码来源:ServerConnectWnd.cpp


示例3: path

QString PathManager::GetDataBasePath()
{
	QString path("");
	if (!GetConfigPath().isEmpty()){
		path = GetConfigPath() + "/database.db";
	}
	return path;
}
开发者ID:cnandroidlib,项目名称:AutopackingAndroid,代码行数:8,代码来源:PathManager.cpp


示例4: GetEditorPrefs

void wxSTEditorOptions::LoadConfig(wxConfigBase &config)
{
    if (HasConfigOption(STE_CONFIG_PREFS) && GetEditorPrefs().Ok())
        GetEditorPrefs().LoadConfig(config, GetConfigPath(STE_OPTION_CFGPATH_PREFS));
    if (HasConfigOption(STE_CONFIG_STYLES) && GetEditorStyles().Ok())
        GetEditorStyles().LoadConfig(config, GetConfigPath(STE_OPTION_CFGPATH_STYLES));
    if (HasConfigOption(STE_CONFIG_LANGS) && GetEditorLangs().Ok())
        GetEditorLangs().LoadConfig(config, GetConfigPath(STE_OPTION_CFGPATH_LANGS));
}
开发者ID:cubemoon,项目名称:game-editor,代码行数:9,代码来源:steopts.cpp


示例5: GuideAlgorithm

GuideAlgorithmLowpass::GuideAlgorithmLowpass(Mount *pMount, GuideAxis axis)
    : GuideAlgorithm(pMount, axis)
{
    double minMove     = pConfig->Profile.GetDouble(GetConfigPath() + "/minMove", DefaultMinMove);
    SetMinMove(minMove);

    double slopeWeight = pConfig->Profile.GetDouble(GetConfigPath() + "/SlopeWeight", DefaultSlopeWeight);
    SetSlopeWeight(slopeWeight);

    reset();
}
开发者ID:hbaidu,项目名称:open-phd-guiding,代码行数:11,代码来源:guide_algorithm_lowpass.cpp


示例6: GetConfigPath

/**
 * CSC_ParseDomainList
 *
 * @return     CDomainList*
 * @exception    -
 * @see        
 */
CDomainList *CSC_ParseDomainList(BOOL fullDownload)
{
    CDomainList *retval = new CDomainList;

    CCsvParse parser;
    CString filename = GetConfigPath() + (fullDownload?pszDomainFileName:pszOnlineDomainName);
    HRESULT hr = parser.Open(filename);
    if (FAILED(hr)) {
        FC_DEBUGPRINT1(_T("CSVPARS> file not found: %s\n"), filename);
        TrcPrint(TRC_ERROR, _T("CSVPARS> file not found: %s\n"), filename);
        return retval;
    }

    BOOL syntax = TRUE;
    for (;;) {
      CSC_DOMAINENTRY domain;
      CString strType, strFile;
      if (!parser.IsEndOfLine()) {
        syntax = FALSE;
        break;
      }
      BOOL ok = parser.ParseNextField(strType);
      if (!ok)
          break;
      strType.MakeLower();
      if (strType == _T("code"))
          domain.type = CSC_DOMAINTYPE_CODE;
      else if (strType == _T("init"))
          domain.type = CSC_DOMAINTYPE_INITIAL;
      else if (strType == _T("config"))
          domain.type = CSC_DOMAINTYPE_CONFIG;
      else if (strType == _T("custom"))
          domain.type = CSC_DOMAINTYPE_CUSTOM;
      else if (strType == _T("debug"))
          domain.type = CSC_DOMAINTYPE_DEBUG;
      else
          domain.type = CSC_DOMAINTYPE_UNKNOWN;
      syntax = parser.ParseNextField(strFile);
      if (!syntax)
          break;
      domain.file = GetConfigPath() + strFile;
      retval->AddTail(domain);
      while (!parser.IsEndOfLine() && parser.ParseNextField(strFile))
          ;
    }
    if (!syntax) {
        FC_DEBUGPRINT3(_T("CSVPARS> syntax error in %s(%d:%d)\n"), filename, parser.GetLineNo(), parser.GetLinePos());
        TrcPrint(TRC_ERROR, _T("CSVPARS> syntax error in %s(%d:%d)\n"), filename, parser.GetLineNo(), parser.GetLinePos());
    }
    return retval;
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:58,代码来源:Config.cpp


示例7: GuideAlgorithm

GuideAlgorithmResistSwitch::GuideAlgorithmResistSwitch(Mount *pMount, GuideAxis axis)
    : GuideAlgorithm(pMount, axis)
{
    double minMove  = pConfig->Profile.GetDouble(GetConfigPath() + "/minMove", DefaultMinMove);
    SetMinMove(minMove);

    double aggr = pConfig->Profile.GetDouble(GetConfigPath() + "/aggression", DefaultAggression);
    SetAggression(aggr);

    bool enable = pConfig->Profile.GetBoolean(GetConfigPath() + "/fastSwitch", true);
    SetFastSwitchEnabled(enable);

    reset();
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:14,代码来源:guide_algorithm_resistswitch.cpp


示例8: modList

Instance::Instance(const wxString &rootDir)
    : modList(this), m_running(false)
{
    if (!rootDir.EndsWith("/"))
        this->rootDir = wxFileName::DirName(rootDir + "/");
    else
        this->rootDir = wxFileName::DirName(rootDir);
    config = new wxFileConfig(wxEmptyString, wxEmptyString, GetConfigPath().GetFullPath(), wxEmptyString,
                              wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_RELATIVE_PATH);
    evtHandler = NULL;
    MkDirs();

    // initialize empty mod lists - they are filled later and only if requested (see apropriate Get* methods)
    modList.SetDir(GetInstModsDir().GetFullPath());
    mlModList.SetDir(GetMLModsDir().GetFullPath());
    coreModList.SetDir(GetCoreModsDir().GetFullPath());
    worldList.SetDir(GetSavesDir().GetFullPath());
    tpList.SetDir(GetTexturePacksDir().GetFullPath());
    modloader_list_inited = false;
    coremod_list_inited = false;
    jar_list_inited = false;
    world_list_initialized = false;
    tp_list_initialized = false;
    parentModel = nullptr;
    UpdateVersion();
}
开发者ID:Glought,项目名称:MultiMC4,代码行数:26,代码来源:instance.cpp


示例9: ERROR_INFO

bool GuideAlgorithmResistSwitch::SetMinMove(double minMove)
{
    bool bError = false;

    try
    {
        if (minMove <= 0.0)
        {
            throw ERROR_INFO("invalid minMove");
        }

        m_minMove = minMove;
        m_currentSide = 0;
    }
    catch (wxString Msg)
    {
        POSSIBLY_UNUSED(Msg);
        bError = true;
        m_minMove = DefaultMinMove;
    }

    pConfig->Profile.SetDouble(GetConfigPath() + "/minMove", m_minMove);

    Debug.Write(wxString::Format("GuideAlgorithmResistSwitch::SetMinMove() returns %d, m_minMove=%.2f\n", bError, m_minMove));

    return bError;
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:27,代码来源:guide_algorithm_resistswitch.cpp


示例10: M_SaveDefaults

void STACK_ARGS M_SaveDefaults (void)
{
	FILE *f;

	if (!DefaultsLoaded)
		return;

	std::string configfile = GetConfigPath();

	// Make sure the user hasn't changed configver
	configver.Set(CONFIGVERSIONSTR);

	if ( (f = fopen (configfile.c_str(), "w")) )
	{
		fprintf (f, "// Generated by Odamex " DOTVERSIONSTR " - don't hurt anything\n");

		// Archive all cvars marked as CVAR_ARCHIVE
		cvar_t::C_ArchiveCVars (f);

		// Archive all active key bindings
		//C_ArchiveBindings (f);

		// Archive all aliases
		DConsoleAlias::C_ArchiveAliases (f);

		// Archive master list
		SV_ArchiveMasters (f);

		fclose (f);
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:31,代码来源:m_misc.cpp


示例11: config_get_string

void OBSBasic::on_actionRemoveSceneCollection_triggered()
{
	std::string newName;
	std::string newPath;

	std::string oldFile = config_get_string(App()->GlobalConfig(),
			"Basic", "SceneCollectionFile");
	std::string oldName = config_get_string(App()->GlobalConfig(),
			"Basic", "SceneCollection");

	auto cb = [&](const char *name, const char *filePath)
	{
		if (strcmp(oldName.c_str(), name) != 0) {
			newName = name;
			newPath = filePath;
			return false;
		}

		return true;
	};

	EnumSceneCollections(cb);

	/* this should never be true due to menu item being grayed out */
	if (newPath.empty())
		return;

	QString text = QTStr("ConfirmRemove.Text");
	text.replace("$1", QT_UTF8(oldName.c_str()));

	QMessageBox::StandardButton button = QMessageBox::question(this,
			QTStr("ConfirmRemove.Title"), text);
	if (button == QMessageBox::No)
		return;

	char path[512];
	int ret = GetConfigPath(path, 512, "obs-studio/basic/scenes/");
	if (ret <= 0) {
		blog(LOG_WARNING, "Failed to get scene collection config path");
		return;
	}

	oldFile.insert(0, path);
	oldFile += ".json";
	os_unlink(oldFile.c_str());

	Load(newPath.c_str());
	RefreshSceneCollections();

	const char *newFile = config_get_string(App()->GlobalConfig(),
			"Basic", "SceneCollectionFile");

	blog(LOG_INFO, "Removed scene collection '%s' (%s.json), "
			"switched to '%s' (%s.json)",
			oldName.c_str(), oldFile.c_str(),
			newName.c_str(), newFile);
	blog(LOG_INFO, "------------------------------------------------");

	UpdateTitleBar();
}
开发者ID:chewcode,项目名称:obs-studio,代码行数:60,代码来源:window-basic-main-scene-collections.cpp


示例12: ERROR_INFO

bool GuideAlgorithmHysteresis::SetHysteresis(double hysteresis)
{
    bool bError = false;

    try
    {
        if (hysteresis < 0.0 || hysteresis > MaxHysteresis)
        {
            throw ERROR_INFO("invalid hysteresis");
        }

        m_hysteresis = hysteresis;

    }
    catch (wxString Msg)
    {
        POSSIBLY_UNUSED(Msg);
        bError = true;
        m_hysteresis = wxMin(wxMax(hysteresis, 0.0), MaxHysteresis);
    }

    pConfig->Profile.SetDouble(GetConfigPath() + "/hysteresis", m_hysteresis);

    return bError;
}
开发者ID:hbaidu,项目名称:open-phd-guiding,代码行数:25,代码来源:guide_algorithm_hysteresis.cpp


示例13: CSC_GetFileType

BOOL CSC_GetFileType(const CString& strFileName, CString& strFileType)
{
    CCsvParse parser;
	int found = 0;
	CString strFile;
	CString filename = GetConfigPath() + pszDomainFileName;

	HRESULT hr = parser.Open(filename);
	if (FAILED(hr)) {
		FC_DEBUGPRINT1(_T("CSVPARS> file not found: %s\n"), filename);
		TrcPrint(TRC_ERROR, _T("CSVPARS> file not found: %s\n"), filename);
	}
	else {
		while(1)
		{
			BOOL ok = parser.ParseNextField(strFileType);
			if (!ok)
				break;
			ok = parser.ParseNextField(strFile);
			if (!ok)
				break;
			if(strFileName.CompareNoCase(strFile) == 0)
			{
				found = 1;
				break;
			}
		}
		parser.Close();
	}

	if(!found) 
		strFileType = _T("unknown");

	return found;
}
开发者ID:LM25TTD,项目名称:ATCMcontrol_Engineering,代码行数:35,代码来源:Config.cpp


示例14: GetConfigPath

void CAppConfig::SaveFavorites()
{
	string fpath = GetConfigPath("favorites");
	FILE* fo = fopen( fpath.c_str() , "w" );
	if( fo )
	{
		// bool has_sensitive_data = false;
		vector<CSite>::iterator it;
		for( it = Favorites.begin(); it != Favorites.end(); ++it )
		{
			CSite& site = *it;
			site.SaveToFile(fo);
			fputc( '\n', fo );

//			if( pSite->GetPasswd().length() )
//				has_sensitive_data = true;
		}
		fclose(fo);

//		if( ! has_sensitive_data )	// No data needs to be encrypted, cancel password.
//			SetUserPasswd( wxEmptyString );

		chmod(fpath.c_str(), 0600);	// Only the owner can access this file.
	}
}
开发者ID:lelou6666,项目名称:pcmanx-gtk2,代码行数:25,代码来源:appconfig.cpp


示例15: M_SaveDefaults

void STACK_ARGS M_SaveDefaults (void)
{
	FILE *f;

	if (!DefaultsLoaded)
		return;

	std::string configfile = GetConfigPath();

	// Make sure the user hasn't changed configver
	configver.Set(CONFIGVERSIONSTR);

	if ( (f = fopen (configfile.c_str(), "w")) )
	{
		fprintf (f, "// Generated by Odasrv " DOTVERSIONSTR "\n\n");

		// Archive all cvars marked as CVAR_ARCHIVE
		fprintf (f, "// --- Console variables ---\n\n");
		cvar_t::C_ArchiveCVars (f);

		// Archive all active key bindings
		//fprintf (f, "// --- Key Bindings ---\n\n");
		//C_ArchiveBindings (f);

		// Archive all aliases
		fprintf (f, "\n// --- Aliases ---\n\n");
		DConsoleAlias::C_ArchiveAliases (f);

		fclose (f);
	}
}
开发者ID:JohnnyonFlame,项目名称:odamex,代码行数:31,代码来源:m_misc.cpp


示例16: GetConfigPath

// Default technique to force a reset on algo parameters is simply to remove the keys from the Registry - a subsequent creation of the algo 
// class will then use default values for everything.  If this is too brute-force for a particular algo, the function can be overridden. 
// For algos that use a min-move parameter, a smart value will be applied based on image scale
void GuideAlgorithm::ResetParams()
{
    wxString configPath = GetConfigPath();
    pConfig->Profile.DeleteGroup(configPath);
    if (GetMinMove() >= 0)
        SetMinMove(SmartDefaultMinMove());
}
开发者ID:AndresPozo,项目名称:phd2,代码行数:10,代码来源:guide_algorithm.cpp


示例17: settings

void PathManager::WriteLastPath(QString &key, QString &val)
{
	QSettings settings(GetConfigPath() + QStringLiteral("/Config.ini"), QSettings::IniFormat);
	settings.beginGroup("LastPathSetting");
	settings.setValue(key, val);
	settings.endGroup();
}
开发者ID:cnandroidlib,项目名称:AutopackingAndroid,代码行数:7,代码来源:PathManager.cpp


示例18: RefreshGlobal

	void RefreshGlobal()
	{
		DoDataExchange(true);
		boost::filesystem::path configFile;
		GetConfigPath(static_cast<const TCHAR *>(m_ConfigLabel), configFile);
		CComPtr<IConfig> config = CreateIConfig(QUERYBUILDER_CFG, configFile);
		CString accountServer = config->Get(GLOBAL_SERVER_ACCOUNT);
		if (accountServer.IsEmpty())
		{
			GetDlgItem(IDC_EDIT_USER).EnableWindow(false);
			GetDlgItem(IDC_EDIT_PASSWORD).EnableWindow(false);
			m_User = _T("");
			m_Password = _T("");
		}
		else
		{
			GetDlgItem(IDC_EDIT_USER).EnableWindow(true);
			GetDlgItem(IDC_EDIT_PASSWORD).EnableWindow(true);
			m_User = config->Get(GLOBAL_USER);
			m_Password = config->Get(GLOBAL_PASSWORD);
		}
		if (m_configPrefs)
			GetDlgItem(IDC_LOGIN_PREFS).EnableWindow(m_ConfigLabel.IsEmpty()==false);
		DoDataExchange();
		m_autoUpdateLink.ShowWindow(SW_HIDE);
		if (!(bool)m_IniFile->Get(GLOBAL_DISABLEAUTOUPDATE))
			clib::thread run(__FUNCTION__, boost::bind(&thread_CheckForUpdates, this, m_autoupdate));

	}
开发者ID:dehilsterlexis,项目名称:eclide-1,代码行数:29,代码来源:LoginDlg.cpp


示例19: CompareRadarAndCameraInArea

static void CompareRadarAndCameraInArea(const t_Point radar_point, const t_Point camera_point, const double area_width, const double area_length, int *p_max_similary) {
	t_Point per_radar_point;
	int per_similary;
	int compare_count;
	int compare_index;
	int max_similary;
	char config_path[255];
	int basic_length;

	ASSERT(NULL != p_max_similary);
	max_similary = 0;
	GetConfigPath(config_path, sizeof(config_path));
	GetBasicLengthOfRadarCompareArea(config_path, &basic_length);
	compare_count = (int)(area_length / basic_length * 1000);
	for (compare_index = 0; compare_index < compare_count; compare_index++) {
		per_radar_point.m_x = radar_point.m_x - area_length / 2 + (double)(basic_length) * compare_index / 1000;
		per_radar_point.m_y = radar_point.m_y;
		CompareRadarAndCameraInLine(per_radar_point, camera_point, area_width, &per_similary);
		if (per_similary > max_similary)
			max_similary = per_similary;
		else
			continue;
	}
	*p_max_similary = max_similary;
}
开发者ID:SangYang,项目名称:ParseRadarData,代码行数:25,代码来源:radar_data_interface.c


示例20: RunRadarDataList

bool RunRadarDataList() {
	const int c_PerComDataSize = 1024;
	unsigned char com_data[1024];
	int act_com_size;
	bool ok_com;
	char config_path[255];
	int port_num;
	int baud_rate;

	GetConfigPath(config_path, sizeof(config_path));
	GetPortNumOfSerialInterface(config_path, &port_num);
	GetBaudRateOfSerialInterface(config_path, &baud_rate);
	ok_com = OpenComport(port_num, baud_rate);
	if (false == ok_com) {
		LOG("OpenComport() error!\n");
		return false;
	}
	else {
		while (true) {
			act_com_size = ReadComport(com_data, c_PerComDataSize);
			if (0 == act_com_size)
				continue;
			else
				AnalyseComData(com_data, act_com_size);
		}
		CloseComport();
		return true;
	}
}
开发者ID:SangYang,项目名称:ParseRadarData,代码行数:29,代码来源:radar_data_interface.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ GetConfigValue函数代码示例发布时间:2022-05-30
下一篇:
C++ GetConfig函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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