當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetConfig函數代碼示例

本文整理匯總了C++中GetConfig函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetConfig函數的具體用法?C++ GetConfig怎麽用?C++ GetConfig使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetConfig函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: InitMem

/* EXPORT->InitMem: Initialise the module.  */
void InitMem(void)
{
   int i;
   Boolean b;
   
   Register(hmem_version, hmem_vc_id);
   CreateHeap(&gstack, "Global Stack",  MSTAK, 1, 0.0, 100000, ULONG_MAX ); /* #### should be max size_t */
   CreateHeap(&gcheap, "Global C Heap", CHEAP, 1, 0.0, 0,      0 );
   numParm = GetConfig("HMEM", TRUE, cParm, MAXGLOBS);
   if (numParm>0){
      if (GetConfInt(cParm,numParm,"TRACE",&i)) trace = i;
      if (GetConfBool(cParm,numParm,"PROTECTSTAKS",&b)) protectStaks = b;
   }
}
開發者ID:2hanson,項目名稱:voice_dialling,代碼行數:15,代碼來源:HMem.c

示例2: Init

extern "C" void Init(const char* serverType, int argc, char* argv[], HandleNameHandleChangedPtr nameHandleCallback, HandleMessagePtr msgCallback, HandleMessageResultPtr msgResultCallback, HandleCommandPtr cmdCallback)
{
#if defined(__LINUX__)
  signal(SIGPIPE, SIG_IGN);
#endif

  InitConfigState(serverType, argc, argv);

  const char* pIp = GetConfig("ip");
  if (NULL == pIp)
    pIp = "127.0.0.1";
  const char* pPort = GetConfig("port");
  int port = 20000;
  if (NULL != pPort)
    port = (int)atoi(pPort);

  tsnprintf(g_Ip, sizeof(g_Ip), "%s", pIp);
  g_Port = port;

  g_HandleNameHandleChangedPtr = nameHandleCallback;
  g_HandleMessagePtr = msgCallback;
  g_HandleMessageResultPtr = msgResultCallback;
  g_HandleCommandPtr = cmdCallback;

  g_pSessionManager = new SessionManager();
  if (NULL != g_pSessionManager) {
    g_pSessionManager->Init();
    g_pSessionManager->UpdateMyName();
  }

  g_pNetIoService = new NetIoService();
  g_pNetIoService->Init();
  g_EventBase = g_pNetIoService->EventBase();
  if (NULL != g_EventBase) {
    g_Connector = new Connector(g_EventBase);
  }
}
開發者ID:CQiao,項目名稱:ServerPlatform,代碼行數:37,代碼來源:main.cpp

示例3: Flash

void wxGISMapView::StartFlashing(wxGISEnumFlashStyle eFlashStyle)
{
    m_eFlashStyle = eFlashStyle;

    Flash(eFlashStyle);

    Refresh();

    //wait drawings end to flash
    if (GetThread() && GetThread()->IsRunning())
    {
        GetThread()->Wait();
    }

    int nMilliSec = DEFAULT_FLASH_PERIOD;
    switch(eFlashStyle)
    {
    case enumGISMapFlashWaves:
        nMilliSec /= 2;
        {
        wxGISAppConfig oConfig = GetConfig();
        if(oConfig.IsOk())
            nMilliSec = oConfig.ReadInt(enumGISHKCU, wxString(wxT("wxGISCommon/map/flash_waves_time")), nMilliSec);
        }
        break;
    default:
    case enumGISMapFlashNewColor:
        {
        wxGISAppConfig oConfig = GetConfig();
        if(oConfig.IsOk())
            nMilliSec = oConfig.ReadInt(enumGISHKCU, wxString(wxT("wxGISCommon/map/flash_newcolor_time")), nMilliSec);
        }
        break;
    };
    m_nDrawingState = enumGISMapFlashing;
    m_timer.Start(nMilliSec);
}
開發者ID:Mileslee,項目名稱:wxgis,代碼行數:37,代碼來源:mapview.cpp

示例4: GetConfig

bool wxGISCatalogMainCmd::OnCreate(wxGISApplicationBase* pApp)
{
	m_pApp = pApp;
    m_pGxApp = dynamic_cast<wxGxApplicationBase*>(pApp);
    if(m_pApp)
    {
        wxGISAppConfig oConfig = GetConfig();
        if(oConfig.IsOk())
            m_nPrevNextSelCount = oConfig.ReadInt(enumGISHKCU, m_pApp->GetAppName() + wxString(wxT("/catalog/prev_next_sel_count")), 7);
    }
    else
        m_nPrevNextSelCount = 7;

	return true;
}
開發者ID:Mileslee,項目名稱:wxgis,代碼行數:15,代碼來源:catalogcmd.cpp

示例5: sTaskMngrServerPath

void wxGISTaskManager::StartTaskManagerServer()
{
#ifdef __WXMSW__
    wxString sTaskMngrServerPath(wxT("wxgistaskmanager.exe"));
#else
    wxString sTaskMngrServerPath(wxT("wxgistaskmanager"));
#endif
    wxGISAppConfig oConfig = GetConfig();
    if(oConfig.IsOk())
        sTaskMngrServerPath = oConfig.Read(enumGISHKCU, wxString(wxT("wxGISCommon/tasks/exe_path")), sTaskMngrServerPath);
    if(wxExecute(sTaskMngrServerPath + wxT(" -a"), wxEXEC_ASYNC | wxEXEC_HIDE_CONSOLE ) == 0)
    {
        wxLogError(_("Task Manager Server start failed. Path '%s'"), sTaskMngrServerPath.c_str());
    }
}
開發者ID:Mileslee,項目名稱:wxgis,代碼行數:15,代碼來源:tskmngr.cpp

示例6: main

int main()
{
    Gateway gate;

    auto cfg = GetConfig();
    if (cfg.empty()) {
        return 0;
    }

    try {
        gate.Run(cfg[0], cfg[1], atoi(cfg[2].c_str()));
    } catch (std::exception& e) {
        LOG("exception: %s", e.what());
    }
}
開發者ID:lbxu,項目名稱:BlackCat,代碼行數:15,代碼來源:Main.cpp

示例7: sprintf_s

_Use_decl_annotations_
Texture AssetLoader::LoadTextureFromFile(const char* filename, bool supportsMips) const
{
    char source[MAX_PATH];
    sprintf_s(source, "%s%s", GetConfig().ContentRoot, filename);

    ImageFileData data;
    LoadImageFileData(source, &data);

    Texture texture(LoadTextureFromMemory(data.Width, data.Height, data.Pitch, data.Data, data.Format, data.MipCount, supportsMips));

    FreeImageFileData(&data);

    return texture;
}
開發者ID:rezanour,項目名稱:randomoldstuff,代碼行數:15,代碼來源:assetloader.cpp

示例8: ParseUnsigned

bool
FlarmDevice::GetBaudRate(unsigned &baud_id, OperationEnvironment &env)
{
  TCHAR buffer[12];
  if (!GetConfig("BAUD", buffer, ARRAY_SIZE(buffer), env))
    return false;

  TCHAR *end_ptr;
  unsigned value = ParseUnsigned(buffer, &end_ptr, 10);
  if (end_ptr == buffer)
    return false;

  baud_id = value;
  return true;
}
開發者ID:DRIZO,項目名稱:xcsoar,代碼行數:15,代碼來源:Device.cpp

示例9:

Buffer *ConfigStore::GetConfigAsBuffer(const char *key, const char *def)
{
        const char *value = NULL;

        value = (char *)GetConfig(key);
        if (value == NULL) {
                if (def == NULL) {
                        return NULL;
                } else {
                  return Util::Str2Buf(def);
                }
        } else {
                return Util::Str2Buf(value);
        }
}
開發者ID:encukou,項目名稱:pki,代碼行數:15,代碼來源:ConfigStore.cpp

示例10: GetConfig

	codeare::error_code
	RemoteConnector::Init (const std::string& name) {
		
		// Prepare configuration for the journey
		std::stringstream  temp;
		temp << GetConfig();
		m_rrsi->config  (temp.str().c_str());
		
		// Initialise back end
        if (m_rrsi->Init (name.c_str(), m_client_id.c_str()) != codeare::OK)
	  return codeare::CANNOT_LOAD_LIBRARY;
		
		return (codeare::error_code)codeare::OK;
		
	}
開發者ID:nomissretep,項目名稱:codeare,代碼行數:15,代碼來源:RemoteConnector.cpp

示例11: switch

void CCopyHandlerApp::OnConfigNotify(uint_t uiPropID)
{
	// is this language
	switch(uiPropID)
	{
	case PP_PLANGUAGE:
		{
			// update language in resource manager
			TCHAR szPath[_MAX_PATH];
			GetConfig().get_string(PP_PLANGUAGE, szPath, _MAX_PATH);
			GetResManager().SetLanguage(ExpandPath(szPath));
			break;
		}
	case PP_LOGENABLELOGGING:
		{
			chcore::TLogger& rLogger = chcore::TLogger::Acquire();

			rLogger.Enable(GetConfig().get_bool(PP_LOGENABLELOGGING));
			break;
		}
	case PP_LOGLEVEL:
		{
			chcore::TLogger& rLogger = chcore::TLogger::Acquire();

			rLogger.set_log_level((int_t)GetConfig().get_unsigned_num(PP_LOGLEVEL));
			break;
		}
	case PP_LOGMAXSIZE:
		{
			chcore::TLogger& rLogger = chcore::TLogger::Acquire();

			rLogger.set_max_size((int_t)GetConfig().get_signed_num(PP_LOGMAXSIZE));
			break;
		}
	}
}
開發者ID:alphaonex86,項目名稱:Copy-handler,代碼行數:36,代碼來源:ch.cpp

示例12: GetConfigAsBool

/**
 * Retrieves configuration value as boolean. If name is
 * not defined, default value is returned.
 */
TPS_PUBLIC bool ConfigStore::GetConfigAsBool(const char *name, bool def)
{
        char *value = NULL;

        value = (char *)GetConfig(name);
        if (value == NULL)
                return def;

        if (PL_CompareStrings("true", value) != 0)
          return true;
	else if (PL_CompareStrings("false", value) != 0)
	  return false;
	else
	  return def;
}
開發者ID:encukou,項目名稱:pki,代碼行數:19,代碼來源:ConfigStore.cpp

示例13:

bool
FlarmDevice::GetRange(unsigned &range)
{
  TCHAR buffer[12];
  if (!GetConfig("RANGE", buffer, ARRAY_SIZE(buffer)))
    return false;

  TCHAR *end_ptr;
  unsigned value = _tcstoul(buffer, &end_ptr, 10);
  if (end_ptr == buffer)
    return false;

  range = value;
  return true;
}
開發者ID:pascaltempez,項目名稱:xcsoar,代碼行數:15,代碼來源:Device.cpp

示例14: ASSERT

void CLATEDView::OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult) 
{
    HTREEITEM hItem;
    CLCConfig* pConfig = NULL;
    CLCBase* pBase = NULL;
    CLCDataType* pType = NULL;

	TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
    ASSERT(pTVDispInfo);
	*pResult = FALSE;

    if(!pTVDispInfo->item.pszText) {
        return;
    }

    hItem = pTVDispInfo->item.hItem;
    if(!hItem) {
        return;
    }

    pConfig = GetConfig();
    if(!pConfig) {
        return;
    }

    pBase = GetNode(hItem);
    if(!pBase) {
        return;
    }


    pType = dynamic_cast<CLCDataType*>(pBase);
    if(pType) {
        //rename a datatype;
        CString str = pTVDispInfo->item.pszText;
        CLCDataType* p = pConfig->GetDatatype(str);
        if(p && p != pType) { //another datatype has same name
            FC_RELEASE_PTR(p);    
            return;
        }

        FC_RELEASE_PTR(p);
        pConfig->RenameDatatype(str,pType);
        SetModified();
        *pResult = TRUE;
        return;
    }
}
開發者ID:LM25TTD,項目名稱:ATCMcontrol_Engineering,代碼行數:48,代碼來源:latedview.cpp

示例15: _T

void RedisConfigUI::DoApplyData()
{
	CEditUI exampleEditUI;
	CComboUI exampleComboUI;

	RedisClient::TDicConfig::const_iterator it = m_dicConfig.begin();
	RedisClient::TDicConfig::const_iterator itend = m_dicConfig.end();
	RedisClient::TDicConfig config;
	for ( ; it!=itend; ++it)
	{
		CDuiString name = _T("redisconfig_");
		CDuiString key = CharacterSet::ANSIToUnicode(it->first).c_str();	
		name.Append(key);
		CControlUI* pCtl = GetPaintMgr()->FindControl(name);

		string val ;
		if (pCtl->GetClass() == exampleEditUI.GetClass())
		{
			CEditUI* pEdit = static_cast<CEditUI*> (pCtl);
			val = CharacterSet::UnicodeToANSI(pEdit->GetText().GetData());
		}
		else if (pCtl->GetClass() == exampleComboUI.GetClass())
		{
			CComboUI* pCombo = static_cast<CComboUI*> (pCtl);
			int idx = pCombo->GetCurSel();
			if (it->first == "loglevel")
			{
				if (idx == 0) val = "debug";
				else if (idx == 1) val = "verbose";
				else if (idx == 2) val = "notice";
				else if (idx == 3) val = "warning";
			}
			else 
			{
				if (idx == 0) val = "yes";
				else if (idx == 1) val = "no";
			}
		}
		if (val != it->second)
		{
			config.insert(std::make_pair(it->first, val));
		}
	}
	if (SetConfig(config) && GetConfig())
	{
		DoFillData();
	}
}
開發者ID:PsyduckMans,項目名稱:RedisStudio,代碼行數:48,代碼來源:RedisConfigUI.cpp


注:本文中的GetConfig函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。