• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LoadConfig函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LoadConfig函数的典型用法代码示例。如果您正苦于以下问题:C++ LoadConfig函数的具体用法?C++ LoadConfig怎么用?C++ LoadConfig使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LoadConfig函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: initialise

static int initialise(void)
{//========================
	int param;
	int result;

	// It seems that the wctype functions don't work until the locale has been set
	// to something other than the default "C".  Then, not only Latin1 but also the
	// other characters give the correct results with iswalpha() etc.
#ifdef PLATFORM_RISCOS
   setlocale(LC_CTYPE,"ISO8859-1");
#else
#if 0
	if(setlocale(LC_CTYPE,"en_US.UTF-8") == NULL)
	{
		if(setlocale(LC_CTYPE,"UTF-8") == NULL)
			setlocale(LC_CTYPE,"");
	}
#endif
#endif


	WavegenInit(22050,0);   // 22050
	if((result = LoadPhData()) != 1)
	{
		if(result == -1)
		{
			fprintf(stderr,"Failed to load espeak-data\n");
			exit(1);
		}
		else
			fprintf(stderr,"Wrong version of espeak-data 0x%x (expects 0x%x) at %s\n",result,version_phdata,path_home);
	}
	LoadConfig();
	SetVoiceStack(NULL);
	SynthesizeInit();

	for(param=0; param<N_SPEECH_PARAM; param++)
		param_stack[0].parameter[param] = param_defaults[param];

	return(0);
}
开发者ID:Jalakas,项目名称:navit,代码行数:41,代码来源:speak.c


示例2: InitTic

int InitTic(void)
{
	FILE	*fil;

	memset(&tic, 0, sizeof(tic));
	memset(&fgroup, 0, sizeof(fgroup));
	LoadConfig();
	sysstart = -1;

	snprintf(tic_fil, PATH_MAX -1, "%s/etc/tic.data", getenv("MBSE_ROOT"));
	if ((fil = fopen(tic_fil, "r")) == NULL)
		return FALSE;

	fread(&tichdr, sizeof(tichdr), 1, fil);
	fseek(fil, 0, SEEK_END);
	tic_cnt = (ftell(fil) - tichdr.hdrsize) / (tichdr.recsize + tichdr.syssize);
	fclose(fil);

	snprintf(tgrp_fil, PATH_MAX -1, "%s/etc/fgroups.data", getenv("MBSE_ROOT"));
	return TRUE;
}
开发者ID:bbs-io,项目名称:mbse,代码行数:21,代码来源:dbtic.c


示例3: GetDlgItem

BOOL CImagePack::OnInitDialog()
{
	CDialog::OnInitDialog();
     
	// TODO:  在此添加额外的初始化
    m_MaxWEdit.SetWindowText("1024");
	m_MaxHEdit.SetWindowText("1024");
    m_SpaceEdit.SetWindowText("1");
	GetDlgItem(IDOK)->SetFocus();
	m_listType.SetCurSel(1);
	m_HistoryCombo.LimitText(MAX_PATH);

	m_pDCCombo = m_HistoryCombo.GetDC();
	m_pFontCombo = m_HistoryCombo.GetFont();
	m_pOldFontCombo = m_pDCCombo->SelectObject(m_pFontCombo);
	m_pDCCombo->GetTextMetrics(&m_tmCombo);
	m_nExtendWidth = ::GetSystemMetrics(SM_CXVSCROLL) + 2*::GetSystemMetrics(SM_CXEDGE);
	LoadConfig();
	return TRUE;  // return TRUE unless you set the focus to a control
	// 异常: OCX 属性页应返回 FALSE
}
开发者ID:lx3389,项目名称:BindImage,代码行数:21,代码来源:ImagePack.cpp


示例4: LoadConfig

// Called before render is available
bool j1App::Awake()
{
	bool ret = LoadConfig();

	if (ret == true)
	{
		p2List_item<j1Module*>* item;
		item = modules.start;

		while (item != NULL && ret == true)
		{
			// TODO 1: Every awake to receive a xml node with their section of the config file if exists

			ret = item->data->Awake(config.child(item->data->name.GetString()));
			item = item->next;
		}

	}

	return ret;
}
开发者ID:weprikjm,项目名称:DevSegonaClasse,代码行数:22,代码来源:j1App.cpp


示例5: LoadConfig

INT_PTR MainDlg::OnLoadProfile( HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam )
{
    std::wstring path;
#ifdef USE64
    if (OpenSaveDialog( L"Xenos profiles (*.xpr64)\0*.xpr64\0", 1, path ))
#else
    if (OpenSaveDialog( L"Xenos profiles (*.xpr)\0*.xpr\0", 1, path ))
#endif
    {
        // Reset loaded images
        _profileMgr.config().images.clear();
        _images.clear();
        _modules.reset();
        _exports.clear();

        LoadConfig( path );
        _status.SetText( 0, blackbone::Utils::StripPath( path ) );
    }

    return TRUE;
}
开发者ID:CodeBlueDev,项目名称:Xenos,代码行数:21,代码来源:MainDlg.cpp


示例6: while

	bool Graphics::Initialise(void)
		/* Initialises the graphics engine with the configuration in graphics.config */	
	{
		while (running){
			// Possible freeze spot if renderloop stops responding
			if (!locked && !kill)
			{
				locked = true;
				kill = true;
				locked = false;
			}
			Delay();
		}

		LoadConfig();
		SDL_Init(INIT_FLAGS);
		SDL_SetVideoMode(res.x, res.y, 0, VIDEO_FLAGS);
		LoadAssets();

		// Need to start renderloop thread
	}
开发者ID:FearlessHornet,项目名称:PotatoGraphics,代码行数:21,代码来源:PotatoGraphics.cpp


示例7: LoadConfig

// Called before render is available
bool j1App::Awake()
{
	bool ret = LoadConfig();
	// self-config
	title.create(app_config.child("title").child_value());
	organization.create(app_config.child("organization").child_value());

	if(ret == true)
	{
		p2List_item<j1Module*>* item;
		item = modules.start;

		while(item != NULL && ret == true)
		{
			const char* debug = item->data->name.GetString();
			ret = item->data->Awake(config.child(item->data->name.GetString()));
			item = item->next;
		}
	}

	return ret == true;
}
开发者ID:DRed96,项目名称:GameDevelopment,代码行数:23,代码来源:j1App.cpp


示例8: new

    void ToastEngine::run()
    {
        g_config = new (std::nothrow)toast::SystemConfig;
        LoadConfig(Daemon::Instance()->config);

        int lastTime = time(NULL);
        // initlize global varables 
        Initlize();

        // Create agent response thread;
        g_agent_response_threads = MultiWorkQueueThreadPool::Create(g_config->num_response_process_threads,  NULL);

        CreateFunctionalThreads();

        Log::Debug("All the thread created " );
        while(false==Daemon::Instance()->IsStop())
        {
            int now = time(NULL);
            usleep(1000000);
        }
        KillThreads(m_OtherThreadPool);
    }
开发者ID:ikewang,项目名称:toast,代码行数:22,代码来源:ToastEngine.cpp


示例9: iUpdateable

cPreMenu::cPreMenu(cInit *apInit)  : iUpdateable("PreMenu")
{
	mpInit = apInit;
	mpDrawer = mpInit->mpGame->GetGraphics()->GetDrawer();

	//Load fonts
	mpFont = mpInit->mpGame->GetResources()->GetFontManager()->CreateFontData("verdana.fnt");
	mpTextFont = mpInit->mpGame->GetResources()->GetFontManager()->CreateFontData("font_computer.fnt");
	
	//Load config file
	LoadConfig();

	//Load text
	tWString sText = kTranslate("MainMenu", "PreMenuText");
	mpTextFont->GetWordWrapRows(750, 19,17,sText,&mvTextRows);
	
	mlMaxChars =0;
	for(size_t i=0; i < mvTextRows.size(); ++i)
		mlMaxChars += (int)mvTextRows[i].length();

	Reset();
}
开发者ID:ArchyInf,项目名称:PenumbraOverture,代码行数:22,代码来源:PreMenu.cpp


示例10: main

int main ( int argc, char **argv ) {
 cmdline.Decipher(argc,argv);
 LoadConfig();
 OUTPUT("Initializing server.\n");
 // This has to be here so broken connections don't end the application.
 signal( SIGPIPE, SIG_IGN );
 if ( signal( SIGINT, signal_handler ) == SIG_ERR ) {
  OUTPUT("Unable to capture SIGINT - Ctrl-C will cause hard shutdown\n");
 }
 int main_port=cfg.integer("paths","main"); if ( !cfg.found ) main_port=3333;
 int rwho_port=cfg.integer("paths","rwho"); if ( !cfg.found ) rwho_port=0;
 int aux_port =cfg.integer("paths","aux" ); if ( !cfg.found ) aux_port=0;
 if ( signalled_abort ) return 0;
 server = new Server( rwho_port, main_port, aux_port );
 while ( !server->shutdown ) {
  timekeeper.Between();
  server->Between();
 }
 OUTPUT("Shutting down.\n");
 server->Shutdown();
 return 0;
}
开发者ID:h3rb,项目名称:pulp,代码行数:22,代码来源:pulp.cpp


示例11: LoadConfig

bool AuctionBotBuyer::Initialize()
{
    LoadConfig();

    bool activeHouse = false;
    for (int i = 0; i < MAX_AUCTION_HOUSE_TYPE; ++i)
    {
        if (_houseConfig[i].BuyerEnabled)
        {
            activeHouse = true;
            break;
        }
    }

    if (!activeHouse)
        return false;

    // load Check interval
    _checkInterval = sAuctionBotConfig->GetConfig(CONFIG_AHBOT_BUYER_RECHECK_INTERVAL) * MINUTE;
    TC_LOG_DEBUG("ahbot", "AHBot buyer interval is %u minutes", _checkInterval / MINUTE);
    return true;
}
开发者ID:DanielBallaSZTE,项目名称:TrinityCorePreWOTLK,代码行数:22,代码来源:AuctionHouseBotBuyer.cpp


示例12: OpenSynth

/* -----------------------------------------------------------------------------*/
Boolean OpenSynth() 
{
        DriverDataPtr data = GetData ();
   
        /* use MidiShare audio buffer size*/ 
        data->buffersize = LoadBufferSize();
        data->soundfont = LoadConfig("Configuration", "SoundFont", GetProfileFullName(kProfileName),kDefaultSoundFont);
       
	if (open_iiwusynth()) {
             LoadSlot ("Output Slots", GetProfileFullName(kProfileName),SynthDriverName);
             return true;
        }else {
             /* tries to use default soundfont */
            data->soundfont = kDefaultSoundFont;
            if (open_iiwusynth()) {
                LoadSlot ("Output Slots", GetProfileFullName(kProfileName),SynthDriverName);
                return true;
            }else{
                return false;
            }
	}
}
开发者ID:AntonLanghoff,项目名称:whitecatlib,代码行数:23,代码来源:msSynthDriver.c


示例13: panel_

Game::Game() :
	panel_(ControlPanel::GetInstance()),
	message_(GET_BITMAP_FONT("retro")),
	controller_(InputController::GetInstance())
{
	Log::SetLogger(new LogDebug());
	LoadConfig(CONFIG_FILE);

	app_.Create(sf::VideoMode(APP_WIDTH, APP_HEIGHT, APP_BPP), APP_TITLE, APP_STYLE);
	app_.SetFramerateLimit(options_.fps);

	const sf::Image& icon = GET_IMG("icon");
	app_.SetIcon(icon.GetWidth(), icon.GetHeight(), icon.GetPixelsPtr());

#ifndef NO_SPLASH
	Splash splash(app_);
	if (!splash.Run())
	{
		exit(EXIT_SUCCESS);
	}
#endif

#ifdef CONSOLE_TEST
	log_ = new LogConsole();
	Log::SetLogger(log_);
#endif

	if (options_.panel_on_top)
	{
		map_.SetPosition(0, ControlPanel::HEIGHT_PX);
	}
    else
    {
		panel_.SetPosition(0, Zone::HEIGHT_PX);
    }

    option_win_ = new Option;
}
开发者ID:charafsalmi,项目名称:ppd-paris-descartes,代码行数:38,代码来源:Game.cpp


示例14: AddLocaleCatalog

int aisradar_pi::Init(void) {
    AddLocaleCatalog( _T("opencpn-aisradar_pi") );
    m_radar_frame_x = m_radar_frame_y = 0;
    m_radar_frame_sx = m_radar_frame_sy = 200;
    m_pRadarFrame = 0;
    m_lat= m_lon=0.;
    m_cog= m_sog=0.;
    m_sats=0;
    ::wxDisplaySize(&m_display_width, &m_display_height);
    m_pconfig = GetOCPNConfigObject();
    LoadConfig();
    if (AisTargets) {  // Init may be called more than once, check for cleanup
        WX_CLEAR_ARRAY(*AisTargets);     
        delete AisTargets;
	}
	AisTargets = GetAISTargetArray();
    m_parent_window = GetOCPNCanvasWindow();
    if(m_radar_show_icon) {
        m_leftclick_tool_id  = InsertPlugInTool(_T(""), 
            _img_radar, 
            _img_radar, 
            wxITEM_NORMAL, 
			wxString::Format(_T("AIS Radar View %d.%d"), 
                PLUGIN_VERSION_MAJOR, 
                PLUGIN_VERSION_MINOR
            ), 
			_T(""), 
            0,
            RADAR_TOOL_POSITION, 
            0,
            this
        );
    }
    return (WANTS_TOOLBAR_CALLBACK | INSTALLS_TOOLBAR_TOOL |
         WANTS_CONFIG | WANTS_PREFERENCES | WANTS_AIS_SENTENCES  |
         WANTS_NMEA_EVENTS | WANTS_PLUGIN_MESSAGING | USES_AUI_MANAGER
    );
}
开发者ID:Verezano,项目名称:radar_pi,代码行数:38,代码来源:aisradar_pi.cpp


示例15: main

int
main (int argc, char **argv)
{
	/* Save our program name - for error messages */
	set_DeadPipe_handler(DeadPipe);
    InitMyApp (CLASS_AUDIO, argc, argv, NULL, NULL, 0 );
	LinkAfterStepConfig();

    ConnectX( ASDefaultScr, PropertyChangeMask );
    ConnectAfterStep ( mask_reg, 0 );
	
	Config = CreateAudioConfig();
	
	LOCAL_DEBUG_OUT("parsing Options ...%s","");
    LoadBaseConfig (GetBaseOptions);
	LoadColorScheme();
    LoadConfig ("audio", GetOptions);

#ifdef HAVE_RPLAY_H
	memset( rplay_table, 0x00, sizeof(RPLAY *)*MAX_SOUNDS);
#endif
	memset( sound_table, 0x00, sizeof(char *)*MAX_SOUNDS);

	if (!SetupSound ())
	{
		show_error("Failed to initialize sound playing routines. Please check your config.");
		return 1;
	}

	/*
	 * Play the startup sound.
	 */
	audio_play (EVENT_Startup);
	SendInfo ( "Nop", 0);
    HandleEvents();

	return 0;
}
开发者ID:Remmy,项目名称:afterstep,代码行数:38,代码来源:Audio.c


示例16: main

int main(int argc, char* argv[])
{
	PTaskInfo task_list;
	int task_num = 0;
	int monitor_tick = 0;

	if(!LoadConfig(task_list, task_num, monitor_tick))
	{
		return -1;
	}
	// output
	printf("monitoring every %d second...", monitor_tick);
	while(1)
	{
		for(int i = 0; i<task_num; i++)
		{
			getProcMemoryUsage(task_list[i]);
		}

		Sleep(monitor_tick * 500);
	}
	return 0;
}
开发者ID:dfdqzp,项目名称:practice,代码行数:23,代码来源:ProcMem.cpp


示例17: FileSelector

void MainFrame::OnBtnFileDstClick(wxCommandEvent& /*event*/)
{
  wxString filename = FileSelector();
  if (filename.IsEmpty() || SameConfig(filename, txtFileSrc))
    return;

  if (!LoadConfig(filename, &mCfgDst) || !mCfgDst)
  {
    wxMessageBox(wxT("Hint: To backup (export) your configuration use the \"Export\" button,\n"
                     "to transfer to an existing (valid Code::Blocks) configuration file,\n"
                     "use the \"Transfer\" button."),
                 wxT("Information"), wxICON_INFORMATION | wxOK);
    mCfgDstValid = false;
    return;
  }

  mFileDst = filename;
  txtFileDst->SetValue(filename);
  mCfgDstValid = true;

  // put configuration to wxListBox
  OfferConfig(mCfgDst, lstCfgDst, &mNodesDst);
}// OnBtnFileDstClick
开发者ID:stahta01,项目名称:codeblocks_r7456,代码行数:23,代码来源:mainframe.cpp


示例18: TacticsInstrument_Dial

TacticsInstrument_BearingCompass::TacticsInstrument_BearingCompass(wxWindow *parent, wxWindowID id, wxString title, int cap_flag) :
TacticsInstrument_Dial(parent, id, title, cap_flag, 0, 360, 0, 360)
{
	SetOptionMarker(5, DIAL_MARKER_SIMPLE, 2);
	SetOptionLabel(20, DIAL_LABEL_ROTATED);
	SetOptionMainValue(_T("%.0f"), DIAL_POSITION_INSIDE);
	//    Get a pointer to the opencpn configuration object

	m_pconfig = GetOCPNConfigObject();

	LoadConfig();
	m_Bearing = NAN;
    m_lat = NAN;
    m_lon = NAN;
	m_CurrDir = NAN;
	m_CurrSpeed = NAN;
	m_ExtraValueDTW = NAN;
    m_MainValue = NAN;
	m_Leeway = 0;
	m_AngleStart = 0;
    m_ExpSmoothDegRange = 0;
    mExpSmDegRange = new ExpSmooth(g_dalphaDeltCoG);
	m_Cog = -999;
	m_Hdt = -999;
	m_diffCogHdt = 0;
	m_predictedSog = NAN;
	m_TWA = NAN;
	m_AWA = -999;
	m_TWS = NAN;
    m_TWD = NAN;
    m_StW = 0.0;
    m_ToWpt = _T("---");
	alpha_diffCogHdt = 0.1;
	m_ExpSmoothDiffCogHdt = 0;
	m_oldExpSmoothDiffCogHdt = 0;
	for (int i = 0; i < COGRANGE; i++) m_COGRange[i] = 0;
}
开发者ID:Hakansv,项目名称:tactics_pi,代码行数:37,代码来源:bearingcompass.cpp


示例19: r3dError

CMasterServerConfig::CMasterServerConfig()
{
  const char* group      = "MasterServer";

  if(_access(configFile, 0) != 0) {
    r3dError("can't open config file %s\n", configFile);
  }
  maxrent = r3dReadCFG_I(configFile, group, "MaxRent",0);
  masterPort_  = r3dReadCFG_I(configFile, group, "masterPort", SBNET_MASTER_PORT);
  clientPort_  = r3dReadCFG_I(configFile, group, "clientPort", GBNET_CLIENT_PORT);
  masterCCU_   = r3dReadCFG_I(configFile, group, "masterCCU",  3000);

  supervisorCoolDownSeconds_ = r3dReadCFG_F(configFile, group, "supervisorCoolDownSeconds",  15.0f);

  #define CHECK_I(xx) if(xx == 0)  r3dError("missing %s value in %s", #xx, configFile);
  #define CHECK_S(xx) if(xx == "") r3dError("missing %s value in %s", #xx, configFile);
  CHECK_I(masterPort_);
  CHECK_I(clientPort_);
  #undef CHECK_I
  #undef CHECK_S

  serverId_    = r3dReadCFG_I(configFile, group, "serverId", 0);
  if(serverId_ == 0)
  {
	MessageBox(NULL, "you must define serverId in MasterServer.cfg", "", MB_OK);
	r3dError("no serverId");
  }
  if(serverId_ > 255 || serverId_ < 1)
  {
	MessageBox(NULL, "bad serverId", "", MB_OK);
	r3dError("bad serverId");
  }

  LoadConfig();

  return;
}
开发者ID:Mateuus,项目名称:newsrcundead,代码行数:37,代码来源:MasterServerConfig.cpp


示例20: mlog

bool ZConfiguration::Load()
{
	bool retValue;

	// Config 는 외부 파일도 읽을수 있도록....외부파일들은 개별 지정해야 함..

#ifdef _PUBLISH
   		////MZFile::SetReadMode( MZIPREADFLAG_ZIP | MZIPREADFLAG_MRS | MZIPREADFLAG_MRS2 | MZIPREADFLAG_FILE );
#endif

	//ZGetLocale()->Init(DEFAULT_COUNTRY);
	if ( !LoadLocale(FILENAME_LOCALE) )
	{
		mlog( "Cannot open %s file.\n", FILENAME_LOCALE);
		return false;
	}

	retValue = LoadConfig(FILENAME_CONFIG);

	//	넷마블 버전은 구분해야함... 넷마블 버전은 MZIPREADFLAG_MRS1 도 읽어야함...

#ifdef _PUBLISH
		////MZFile::SetReadMode( MZIPREADFLAG_MRS2 );
#endif

	if ( !LoadSystem(FILENAME_SYSTEM))
	{
		mlog( "Cannot open %s file.\n", FILENAME_SYSTEM);
		return false;
	}

	if ( !retValue)
		return false;


	return retValue;
}
开发者ID:kooksGame,项目名称:life-marvelous,代码行数:37,代码来源:ZConfiguration.cpp



注:本文中的LoadConfig函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LoadCursor函数代码示例发布时间:2022-05-30
下一篇:
C++ LoadByte函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap