本文整理汇总了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;
}
}
示例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);
}
}
示例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);
}
示例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;
}
示例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());
}
}
示例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());
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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;
}
示例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;
}
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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();
}
}