本文整理汇总了C++中ReadConfigFile函数的典型用法代码示例。如果您正苦于以下问题:C++ ReadConfigFile函数的具体用法?C++ ReadConfigFile怎么用?C++ ReadConfigFile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ReadConfigFile函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:zfh1005,项目名称:multi_DUT,代码行数:29,代码来源:ControlLogic.cpp
示例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;
}
开发者ID:jufei,项目名称:BtsShell,代码行数:30,代码来源:Remotely.c
示例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;
}
开发者ID:BackupTheBerlios,项目名称:gltron-svn,代码行数:33,代码来源:tracker_gltron.c
示例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;
}
开发者ID:gcfavorites,项目名称:feos-tas,代码行数:27,代码来源:conf.c
示例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;
}
开发者ID:envycointeam,项目名称:envycoin,代码行数:38,代码来源:envycoin-cli.cpp
示例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;
}
开发者ID:BrogulT,项目名称:bitcoin,代码行数:33,代码来源:bitcoin-cli.cpp
示例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();
}
开发者ID:Mystro256,项目名称:wiisxr,代码行数:35,代码来源:cfg.c
示例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();
}
开发者ID:bsv798,项目名称:pcsxr,代码行数:26,代码来源:cfg.c
示例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);
}
开发者ID:jufei,项目名称:BtsShell,代码行数:43,代码来源:Remotely.c
示例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;
}
开发者ID:burlen,项目名称:visit_vtk_7_src,代码行数:28,代码来源:SingleAttributeConfigManager.C
示例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 */
开发者ID:ncareol,项目名称:ncplot,代码行数:55,代码来源:ncplot.c
示例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);
}
开发者ID:metux,项目名称:wwwoffle,代码行数:41,代码来源:configdata.c
示例13: ReadConfigSPU
void ReadConfigSPU(void)
{
iVolume=2;
iXAPitch=0;
iSPUIRQWait=0;
iUseTimer=2;
iUseReverb=2;
iUseInterpolation=2;
iDisStereo=0;
ReadConfigFile();
}
开发者ID:tigerking,项目名称:psone,代码行数:12,代码来源:cfg.c
示例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]);
}
开发者ID:fannq,项目名称:SEIMS,代码行数:52,代码来源:ModuleFactory.cpp
示例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;
}
开发者ID:wiplug,项目名称:tvdaemon,代码行数:13,代码来源:Adapter.cpp
示例16: main
int
main(int argc, char *argv[])
{
int opt;
while ((opt = getopt(argc, argv, "ql:d:uw:f:bc:s:")) != -1) {
switch (opt) {
case 'q':
quietFlag = 1;
break;
case 'd': {
char *c = optarg;
while (*c) {
Debug_SetFlag(*c, 1);
c++;
}
break;
}
default:
PrintUsageAndExit(argv[0]);
}
}
if (optind != argc-1) {
PrintUsageAndExit(argv[0]);
}
char *configfile = argv[optind];
int err = ReadConfigFile(configfile);
if (err < 0) {
exit(EXIT_FAILURE);
}
/*
* Since we create a process (i.e. fork) we need to clean up its state when
* we exit. We do this by having the OS send us a signal when something
* finishes.
*/
signal(SIGCHLD, handleSIGCHLD);
err = InitializeBackends();
if (err < 0) {
exit(EXIT_FAILURE);
}
int listenfd = SetupListenSocket();
if(listenfd < 0){
exit(EXIT_FAILURE);
}
HandleConnections(listenfd);
return 0; /* Never reached. */
}
开发者ID:JavierPalomares90,项目名称:CS110,代码行数:51,代码来源:webserver.c
示例17: ReadVendors
bool SourcesList::ReadVendors()
{
Configuration Cnf;
string CnfFile = _config->FindFile("Dir::Etc::vendorlist");
if (FileExists(CnfFile) == true) {
if (ReadConfigFile(Cnf, CnfFile, true) == false) {
return false;
}
}
for (VendorRecord *vr : VendorRecords) {
delete vr;
}
VendorRecords.clear();
// Process 'simple-key' type sections
const Configuration::Item *Top = Cnf.Tree("simple-key");
for (Top = (Top == 0 ? 0 : Top->Child); Top != 0; Top = Top->Next) {
Configuration Block(Top);
VendorRecord Vendor;
Vendor.VendorID = Top->Tag;
Vendor.FingerPrint = Block.Find("Fingerprint");
Vendor.Description = Block.Find("Name");
char *buffer = new char[Vendor.FingerPrint.length() + 1];
char *p = buffer;;
for (string::const_iterator I = Vendor.FingerPrint.begin();
I != Vendor.FingerPrint.end(); ++I) {
if (*I != ' ' && *I != '\t') {
*p++ = *I;
}
}
*p = 0;
Vendor.FingerPrint = buffer;
delete[]buffer;
if (Vendor.FingerPrint.empty() == true ||
Vendor.Description.empty() == true) {
_error->Error("Vendor block %s is invalid",
Vendor.VendorID.c_str());
continue;
}
AddVendorNode(Vendor);
}
return !_error->PendingError();
}
开发者ID:DimStar77,项目名称:PackageKit,代码行数:50,代码来源:apt-sourceslist.cpp
示例18: inf
DataNode *
VLIFileManager::ReadConfigFile(const char *filename)
{
DataNode *node = 0;
// Try and open the file for reading.
std::ifstream inf(filename, ios::in); // | ios::trunc);
if (inf.is_open() == false)
return node;
node = ReadConfigFile(inf);
inf.close();
return node;
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:14,代码来源:VLIFileManager.C
示例19: main
int main (int argc, char **argv)
/* simple main program */
{
/* don't tell me that this condition looks ugly... */
if ( (argc > 2)
|| (
(argc == 2)
&& (
(strcmp(argv[1],PRINT_VERSION) == 0)
|| (strcmp(argv[1],PRINT_VERSION_LONG) == 0)
)
)
) {
printf(PROGRAM_VERSION "\n");
printf(PROGRAM_INFOTEXT "\n");
exit(0);
};
SetDefaultValues();
if (config.debug > 1) {
Print(stdout,PROGRAM_VERSION," starting up");
}
InstallSignalHandler();
if (argc > 1) {
free(config.config_file);
config.config_file = AllocString(argv[1]);
}
ReadConfigFile();
if (config.daemon) {
ForkToBackground();
}
OpenJoystick();
AddMissingCalibrations();
ActionLoop();
CloseJoystick();
Print(stdout,PROGRAM_VERSION," quits now (should've never come around here!?)");
return 0;
}
开发者ID:mmitch,项目名称:joyd,代码行数:49,代码来源:joyd.c
示例20: AppInitRPC
//
// This function returns either one of EXIT_ codes when it's expected to stop the process or
// CONTINUE_EXECUTION when it's expected to continue further.
//
static int AppInitRPC(int argc, char* argv[])
{
//
// Parameters
//
ParseParameters(argc, argv);
if (argc<2 || IsArgSet("-?") || IsArgSet("-h") || IsArgSet("-help") || IsArgSet("-version")) {
std::string strUsage = strprintf(_("%s RPC client version"), _(PACKAGE_NAME)) + " " + FormatFullVersion() + "\n";
if (!IsArgSet("-version")) {
strUsage += "\n" + _("Usage:") + "\n" +
" bitcoin-cli [options] <command> [params] " + strprintf(_("Send command to %s"), _(PACKAGE_NAME)) + "\n" +
" bitcoin-cli [options] -named <command> [name=value] ... " + strprintf(_("Send command to %s (with named arguments)"), _(PACKAGE_NAME)) + "\n" +
" bitcoin-cli [options] help " + _("List commands") + "\n" +
" bitcoin-cli [options] help <command> " + _("Get help for a command") + "\n";
strUsage += "\n" + HelpMessageCli();
}
fprintf(stdout, "%s", strUsage.c_str());
if (argc < 2) {
fprintf(stderr, "Error: too few parameters\n");
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
if (!boost::filesystem::is_directory(GetDataDir(false))) {
fprintf(stderr, "Error: Specified data directory \"%s\" does not exist.\n", GetArg("-datadir", "").c_str());
return EXIT_FAILURE;
}
try {
ReadConfigFile(GetArg("-conf", BITCOIN_CONF_FILENAME));
} catch (const std::exception& e) {
fprintf(stderr,"Error reading configuration file: %s\n", e.what());
return EXIT_FAILURE;
}
// Check for -testnet or -regtest parameter (BaseParams() calls are only valid after this clause)
try {
SelectBaseParams(ChainNameFromCommandLine());
} catch (const std::exception& e) {
fprintf(stderr, "Error: %s\n", e.what());
return EXIT_FAILURE;
}
if (GetBoolArg("-rpcssl", false))
{
fprintf(stderr, "Error: SSL mode for RPC (-rpcssl) is no longer supported.\n");
return EXIT_FAILURE;
}
return CONTINUE_EXECUTION;
}
开发者ID:mpatc,项目名称:bitcoin,代码行数:53,代码来源:bitcoin-cli.cpp
注:本文中的ReadConfigFile函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论