本文整理汇总了C++中GetConfig函数的典型用法代码示例。如果您正苦于以下问题:C++ GetConfig函数的具体用法?C++ GetConfig怎么用?C++ GetConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetConfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: while
////////////////////////////////////////////////////////////////////////////////
/// Process incoming requests
int CameraV4L2::HandleRequests()
{
void *client;
char request[PLAYER_MAX_REQREP_SIZE];
char outBuf[PLAYER_MAX_REQREP_SIZE];
int len;
while ((len = GetConfig(&client, &request, sizeof(request),NULL)) > 0)
{
int ret = -1;
PLAYER_MSG2(2,"Got Reguest %c (size: %d)", request[0], len);
if (len>1 && (request[0]=='g' || request[0]=='G')){
// pobranie jakiejs wartosci
PLAYER_MSG0(2,"Get type request");
ret = handleCommand(request, len, outBuf, PLAYER_MAX_REQREP_SIZE-1);
if (ret==0) {
outBuf[PLAYER_MAX_REQREP_SIZE-1] = '\0';
PLAYER_MSG1(2,"Sending Ack: %s", outBuf);
if (PutReply(client, PLAYER_MSGTYPE_RESP_ACK, outBuf, strlen(outBuf)+1,NULL) != 0)
PLAYER_ERROR("PutReply() failed");
} else {
PLAYER_MSG0(2,"Sendinf NACK");
if (PutReply(client, PLAYER_MSGTYPE_RESP_NACK,NULL) != 0)
PLAYER_ERROR("PutReply() failed");
}
} else {
if (len>0) {
ret = handleCommand(request, len);
}
if (ret == 0){
PLAYER_MSG0(2,"Sending Ack");
if (PutReply(client, PLAYER_MSGTYPE_RESP_ACK,NULL) != 0)
PLAYER_ERROR("PutReply() failed");
} else {
PLAYER_MSG0(2,"Sending Nack");
if (PutReply(client, PLAYER_MSGTYPE_RESP_NACK,NULL) != 0)
PLAYER_ERROR("PutReply() failed");
}
}
// if framegrabber is slow(1-10s), it is worth handling all commands at once
//usleep(30000);
}
return 0;
}
开发者ID:Deeptiman,项目名称:midpath4dingoo,代码行数:50,代码来源:camerav4l2.cpp
示例17: StatusUnstable
bool Game::Fail(){
StatusUnstable();
ExecTrials++;
if(ExecTrials >= GetConfig()->MaxExecTrials) {
Status = Failed;
GetOut()->Put(Parent, OutPrefix, " Maximum execution attempts for game exceeded.", NULL);
StatusStable();
return true;
} else {
StatusStable();
if(cleanup) return true;
Halt(5);
Start();
return false;
}
}
开发者ID:jcaesar,项目名称:crctrl,代码行数:16,代码来源:GameControl.cpp
示例18: InitMap
/* EXPORT->InitMap: initialise configuration parameters */
void InitMap(void)
{
int i;
double f;
Register(hmap_version,hmap_vc_id);
nParm = GetConfig("HMAP", TRUE, cParm, MAXGLOBS);
if (nParm>0){
if (GetConfInt(cParm,nParm,"TRACE",&i)) trace = i;
if (GetConfInt(cParm,nParm,"MINEGS",&i)) minEgs = i;
if (GetConfFlt(cParm,nParm,"MINOBS",&f)) minObs = f;
if (GetConfFlt(cParm,nParm,"MINVAR",&f)) minVar = f;
if (GetConfFlt(cParm,nParm,"MAPTAU",&f)) mapTau = f;
if (GetConfFlt(cParm,nParm,"MIXWEIGHTFLOOR",&f)) mixWeightFloor = MINMIX*f;
}
}
开发者ID:lovecpp2014,项目名称:htk-kenlm,代码行数:17,代码来源:HMap.c
示例19: GetDB
mongo::DBClientConnection& GetDB() {
if(!connected) {
std::string host(GetConfig().GetAttribute("Database.host").ToString());
LOGINFO("正在连接到 " + host + " 的 mongodb 服务器");
try {
dbconnection.connect(host);
connected = true;
LOGINFO("已连接");
} catch(mongo::DBException &e) {
LOGERROR("连接数据库时发生错误: " + e.toString());
throw FCException("无法连接至数据库");
}
}
return dbconnection;
}
开发者ID:RyokoAkizuki,项目名称:freshcity,代码行数:16,代码来源:db.cpp
示例20: if
bool
FlarmDevice::GetStealthMode(bool &enabled)
{
TCHAR buffer[2];
if (!GetConfig("PRIV", buffer, ARRAY_SIZE(buffer)))
return false;
if (buffer[0] == _T('1'))
enabled = true;
else if (buffer[0] == _T('0'))
enabled = false;
else
return false;
return true;
}
开发者ID:pascaltempez,项目名称:xcsoar,代码行数:16,代码来源:Device.cpp
注:本文中的GetConfig函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论