本文整理汇总了C++中ReadConfigFile函数的典型用法代码示例。如果您正苦于以下问题:C++ ReadConfigFile函数的具体用法?C++ ReadConfigFile怎么用?C++ ReadConfigFile使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReadConfigFile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printf
/*
init the CControlLogic class
*/
int CControlLogic::Init()
{
if (!UIConnection())//establish connection UI between testperf
{
printf("ERROR Can not connect server.exit\n");
return 0;
}
if (!ReadConfigFile())
{
return 0;
}
if (!StartAMBTUIParseCammandTask())
{
return 0;
}
if(!StartAutoFixtureTask())
{
return 0;
}
usleep(1);
return 1;
}
示例2: ConfigCMD
int CVICALLBACK ConfigCMD (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
DimAction(1);
WriteLog();
ResetTextBox (panelHandle, PANEL_TEXTBOX, "");
if (ReadConfigFile(BBUCOMMON_CONFIGCMD))
{
if (0==InstallPopup(configHandle))
{
SetPanelAttribute (configHandle, ATTR_TITLE, "CheckCMD");
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
}
}
else
{
SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from cmd.txt error,please check it by manual!\r\n");
}
DimAction(0);
break;
}
return 0;
}
示例3: main
int main( int argc, char *argv[] ) {
//get args
get_args(argc, argv);
initDefaultSettings();
//read settings file
ReadConfigFile();
//init system
SystemInit(&argc,argv);
initNetwork();
//starting the tracker
start_tracker();
while(1) {
//parse network
handle_tracker();
check_serveractivity();
#ifdef macintosh
mac_yield_cpu (10000);
#else
SDL_Delay(10);
#endif
}
stop_tracker();
//cleanup
return 0;
}
示例4: ReadConfig
void ReadConfig(void)
{
// defaults
iResX=640;
iResY=480;
iColDepth=16;
iWindowMode=1;
iUseScanLines=0;
iUseDither=0;
UseFrameLimit=0;
UseFrameSkip=0;
iFrameLimit=2;
fFrameRate=200.0f;
dwCfgFixes=0;
iUseFixes=0;
iUseNoStretchBlt=1;
iShowFPS=0;
bSSSPSXLimit=FALSE;
// read sets
ReadConfigFile();
// additional checks
if (!iColDepth) iColDepth=32;
if (iUseFixes) dwActFixes=dwCfgFixes;
}
示例5: AppInitRPC
//////////////////////////////////////////////////////////////////////////////
//
// Start
//
static bool AppInitRPC(int argc, char* argv[])
{
//
// Parameters
//
ParseParameters(argc, argv);
if (!boost::filesystem::is_directory(GetDataDir(false)))
{
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
return false;
}
ReadConfigFile(mapArgs, mapMultiArgs);
// Check for -testnet or -regtest parameter (TestNet() calls are only valid after this clause)
if (!SelectParamsFromCommandLine()) {
fprintf(stderr, "Error: Invalid combination of -regtest and -testnet.\n");
return false;
}
if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
{
// First part of help message is specific to RPC client
std::string strUsage = _("Envycoin RPC client version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" envycoin-cli [options] <command> [params] " + _("Send command to Envycoin server") + "\n" +
" envycoin-cli [options] help " + _("List commands") + "\n" +
" envycoin-cli [options] help <command> " + _("Get help for a command") + "\n";
strUsage += "\n" + HelpMessageCli(true);
fprintf(stdout, "%s", strUsage.c_str());
return false;
}
return true;
}
示例6: AppInitRPC
//////////////////////////////////////////////////////////////////////////////
//
// Start
//
static bool AppInitRPC(int argc, char* argv[])
{
//
// Parameters
//
ParseParameters(argc, argv);
if (!boost::filesystem::is_directory(GetDataDir(false)))
{
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", mapArgs["-datadir"].c_str());
return false;
}
ReadConfigFile(mapArgs, mapMultiArgs);
if (argc<2 || mapArgs.count("-?") || mapArgs.count("--help"))
{
// First part of help message is specific to RPC client
std::string strUsage = _("Bitcoin RPC client version") + " " + FormatFullVersion() + "\n\n" +
_("Usage:") + "\n" +
" bitcoin-cli [options] <command> [params] " + _("Send command to Bitcoin server") + "\n" +
" bitcoin-cli [options] help " + _("List commands") + "\n" +
" bitcoin-cli [options] help <command> " + _("Get help for a command") + "\n";
strUsage += "\n" + HelpMessage(HMM_BITCOIN_CLI);
fprintf(stdout, "%s", strUsage.c_str());
return false;
}
return true;
}
示例7: ReadConfig
void ReadConfig(void)
{
// defaults
iResX=640;
iResY=480;
iWinSize=MAKELONG(iResX,iResY);
iColDepth=16;
iWindowMode=1;
iUseScanLines=0;
if (frameLimit == FRAMELIMIT_AUTO)
{
UseFrameLimit=1;
iFrameLimit=2;
}
else
{
UseFrameLimit=0;
iFrameLimit=0;
}
UseFrameSkip = frameSkip;
fFrameRate=60.0f;
dwCfgFixes=0;
iUseFixes=0;
iUseNoStretchBlt=1;
iShowFPS=0;
bSSSPSXLimit=FALSE;
// read sets
ReadConfigFile();
// additional checks
if(!iColDepth) iColDepth=32;
if(iUseFixes) dwActFixes=dwCfgFixes;
SetFixes();
}
示例8: ReadConfig
void ReadConfig(void)
{
// defaults
iResX=640;iResY=480;
iWinSize=MAKELONG(iResX,iResY);
iColDepth=32;
iWindowMode=1;
iMaintainAspect=0;
UseFrameLimit=1;
UseFrameSkip=0;
iFrameLimit=2;
fFrameRate=200.0f;
dwCfgFixes=0;
iUseFixes=0;
iUseNoStretchBlt=0;
iUseDither=0;
iShowFPS=0;
// read sets
ReadConfigFile();
// additional checks
if(!iColDepth) iColDepth=32;
if(iUseFixes) dwActFixes=dwCfgFixes;
SetFixes();
}
示例9: Config
//////////////////////////////////////////manualbar callback function/////////////////////////////////////////////////
void CVICALLBACK Config (int menuBar, int menuItem, void *callbackData,
int panel)
{
DimAction(1);
WriteLog();
ResetTextBox (panelHandle, PANEL_TEXTBOX, "");
switch (menuItem)
{
case MENUBAR_CONFIG_CONFIGIP:
if (ReadConfigFile(MENUBAR_CONFIG_CONFIGIP))
{
if (0==InstallPopup(configHandle))
{
SetPanelAttribute (configHandle, ATTR_TITLE, "CheckBBUIP");
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
}
}
else
{
SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from bbuip.txt error,please check it by manual!\r\n");
}
break;
case BBUCOMMON_CONFIGCMD:
if (ReadConfigFile(BBUCOMMON_CONFIGCMD))
{
if (0==InstallPopup(configHandle))
{
SetPanelAttribute (configHandle, ATTR_TITLE, "CheckCMD");
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_ENTER_IS_NEWLINE, 1);
SetCtrlAttribute (configHandle, CONFIG_BOX, ATTR_TEXT_BGCOLOR, VAL_OFFWHITE);
}
}
else
{
SetCtrlVal (panelHandle, PANEL_TEXTBOX, "Read data from cmd.txt error,please check it by manual!\r\n");
}
}
DimAction(0);
}
示例10: ReadConfigFile
// ****************************************************************************
// Method: SingleAttributeConfigManager::Import
//
// Purpose:
// Imports the atribute from the named file.
//
// Returns: true on success; false otherwise
//
// Programmer: Jeremy Meredith
// Creation: January 2, 2009
//
// Modifications:
//
// Tom Fogal, Fri Mar 6 10:26:12 MST 2009
// Fix: function wasn't returning anything in the `success' case.
//
// ****************************************************************************
bool
SingleAttributeConfigManager::Import(std::istream& in)
{
DataNode *node = ReadConfigFile(in);
if (!node)
return false;
attribute->SetFromNode(node);
return true;
}
示例11: main
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int n;
Arg args[6];
Initialize();
ProcessArgs(argv);
ReadConfigFile();
AutoScale();
if (!Interactive)
PrintPS((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
else
{
AppShell = XtAppInitialize(&appContext, APP_CLASS, NULL, 0, &argc, argv,
fallback_resources, NULL, 0);
XtGetApplicationResources(AppShell, (caddr_t) &iv, resources,
XtNumber(resources), NULL, 0);
n = 0;
MainShell = XtCreatePopupShell("topLevelShell",
topLevelShellWidgetClass, AppShell, args, n);
MainWindow = CreateMainWindow(MainShell);
n = 0;
ControlShell = XtCreatePopupShell("controlShell",
topLevelShellWidgetClass, AppShell, args, n);
CreateControlWindow(ControlShell);
CreateErrorBox(AppShell);
CreateQueryBox(AppShell);
CreateWarningBox(AppShell);
CreateFileSelectionBox(AppShell);
if (NumberDataFiles > 0)
NewDataFile((Widget)NULL, (XtPointer)NULL, (XtPointer)NULL);
OpenControlWindow(NULL, NULL, NULL);
XtManageChild(MainWindow);
XtPopup(XtParent(MainWindow), XtGrabNone);
if (RealTime)
XtAppAddTimeOut(appContext, 1000, UpdateDataRT, NULL);
XtAppMainLoop(appContext);
}
return(0);
} /* END MAIN */
示例12: ReadConfigurationFile
int ReadConfigurationFile(int fd)
{
static int first_time=1;
char *errmsg;
if(first_time)
{
errmsg=ReadConfigFile(1);
if(errmsg)
{
if(fd!=-1)
write_string(fd,errmsg);
free(errmsg);
return(1);
}
SetLocalPort(ConfigInteger(HTTP_Port));
first_time=0;
}
errmsg=ReadConfigFile(0);
if(errmsg)
{
if(fd!=-1)
write_string(fd,errmsg);
free(errmsg);
return(1);
}
SyslogLevel=ConfigInteger(LogLevel);
SetDNSTimeout(ConfigInteger(DNSTimeout));
SetConnectTimeout(ConfigInteger(ConnectTimeout));
return(0);
}
示例13: ReadConfigSPU
void ReadConfigSPU(void)
{
iVolume=2;
iXAPitch=0;
iSPUIRQWait=0;
iUseTimer=2;
iUseReverb=2;
iUseInterpolation=2;
iDisStereo=0;
ReadConfigFile();
}
示例14: ReadConfigFile
void ModuleFactory::Init(const string& configFileName)
{
ReadConfigFile(configFileName.c_str());
#ifdef USE_MONGODB
ReadParametersFromMongoDB();
//#else
//ReadParametersFromSQLite();
#endif
size_t n = m_moduleIDs.size();
// read all the .dll or .so and create objects
for (size_t i = 0; i < n; i++)
{
string id = m_moduleIDs[i];
string dllID = id;
// for ITP modules, the input ids are ITP_T, ITP_P and ITP should be used as ID name
if(id.find(MID_ITP) != string::npos)
#ifndef linux
dllID = MID_ITP;
#else
dllID = "lib" + string(MID_ITP);
#endif
else if (id.find(MID_TSD_RD) != string::npos)
#ifndef linux
dllID = MID_TSD_RD;
#else
dllID = "lib" + string(MID_TSD_RD);
#endif
#ifdef INTEL_COMPILER
dllID = dllID + "_intel";
#endif
#ifdef INTEL_COMPILER_SINGLE
dllID = dllID + "_intel_single";
#endif
#ifdef SINGLE
dllID = dllID + "_single";
#endif
// load function pointers from DLL
ReadDLL(id, dllID);
// load metadata
MetadataFunction metadataInfo = m_metadataFuncs[id];
const char* metadata = metadataInfo();
m_metadata[id] = metadata;
// parse the metadata
TiXmlDocument doc;
doc.Parse(metadata);
ReadParameterSetting(id, doc, m_settings[id]);
ReadInputSetting(id, doc, m_settings[id]);
ReadOutputSetting(id, doc, m_settings[id]);
}
示例15: LoadConfig
bool Adapter::LoadConfig( )
{
if( !ReadConfigFile( ))
return false;
ReadConfig( "Name", name );
ReadConfig( "UDev-ID", uid );
Log( "Loading Adapter '%s'", name.c_str( ));
if( !CreateFromConfigFactory<Frontend, Adapter>( *this, "frontend", frontends ))
return false;
return true;
}