本文整理汇总了C++中Load函数的典型用法代码示例。如果您正苦于以下问题:C++ Load函数的具体用法?C++ Load怎么用?C++ Load使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Load函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: s
int StorageObject::Load(char *fName)
{
IoDataStream s(fName, "r");
return(Load(s));
}
示例2: Load
xmlNodePtr HisBase::GetNodePtr()
{
Load();
return node;
}
示例3:
IDynamicObject& MemoryCache::Access(const std::string& id)
{
return *Load(id).content_;
}
示例4: return
bool CSG_MetaData::Create(CSG_File &Stream)
{
return( Load(Stream) );
}
示例5: Item
Weapon::Weapon(std::string _id, JsonBox::Value& _v, EntityManager* _manager)
: Item(_id, _v, _manager)
{
Load(_v, _manager);
}
示例6: xml
//Metoda ³aduj¹ca dane
bool CMonsterTemplate::Load(const std::string &name)
{
CXml xml(name, "root" );
return Load(xml);
}
示例7: m_Name
Texture::Texture(const String& name, const String& filename)
: m_Name(name), m_FileName(filename)
{
m_TID = Load();
}
示例8: switch
uint32 GameBase::EngineMessageFn(uint32 messageID, void *pData, float fData)
{
switch(messageID)
{
case MID_ACTIVATING:
{
g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, USRFLG_GAMEBASE_ACTIVE, USRFLG_GAMEBASE_ACTIVE);
}
break;
case MID_DEACTIVATING:
{
g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, 0, USRFLG_GAMEBASE_ACTIVE);
}
break;
case MID_PRECREATE:
{
uint32 dwRet = BaseClass::EngineMessageFn(messageID, pData, fData);
int nInfo = (int)fData;
if (nInfo == PRECREATE_WORLDFILE || nInfo == PRECREATE_STRINGPROP || nInfo == PRECREATE_NORMAL)
{
ObjectCreateStruct* pocs = (ObjectCreateStruct*)pData;
if( !ReadProp( pocs ))
return 0;
}
return dwRet;
}
break;
case MID_OBJECTCREATED:
{
if( fData != OBJECTCREATED_SAVEGAME )
{
ObjectCreated( reinterpret_cast<const GenericPropList*>(pData) );
}
}
break;
case MID_MODELSTRINGKEY:
{
HandleModelString( (ArgList*)pData );
}
break;
case MID_SAVEOBJECT:
{
Save((ILTMessage_Write*)pData);
}
break;
case MID_LOADOBJECT:
{
Load((ILTMessage_Read*)pData);
}
break;
default:
break;
}
return BaseClass::EngineMessageFn(messageID, pData, fData);
}
示例9: MessageBox
// Dialog box handling functions
void
vncProperties::Show(BOOL show, BOOL usersettings)
{
if (show)
{
if (!m_allowproperties)
{
// If the user isn't allowed to override the settings then tell them
MessageBox(NULL, NO_OVERRIDE_ERR, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
// Verify that we know who is logged on
if (usersettings) {
char username[UNLEN+1];
if (!vncService::CurrentUser(username, sizeof(username)))
return;
if (strcmp(username, "") == 0) {
MessageBox(NULL, NO_CURRENT_USER_ERR, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
} else {
// We're trying to edit the default local settings - verify that we can
HKEY hkLocal, hkDefault;
BOOL canEditDefaultPrefs = 1;
DWORD dw;
if (RegCreateKeyEx(HKEY_LOCAL_MACHINE,
WINVNC_REGISTRY_KEY,
0, REG_NONE, REG_OPTION_NON_VOLATILE,
KEY_READ, NULL, &hkLocal, &dw) != ERROR_SUCCESS)
canEditDefaultPrefs = 0;
else if (RegCreateKeyEx(hkLocal,
"Default",
0, REG_NONE, REG_OPTION_NON_VOLATILE,
KEY_WRITE | KEY_READ, NULL, &hkDefault, &dw) != ERROR_SUCCESS)
canEditDefaultPrefs = 0;
if (hkLocal) RegCloseKey(hkLocal);
if (hkDefault) RegCloseKey(hkDefault);
if (!canEditDefaultPrefs) {
MessageBox(NULL, CANNOT_EDIT_DEFAULT_PREFS, "WinVNC Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
}
// Now, if the dialog is not already displayed, show it!
if (!m_dlgvisible)
{
if (usersettings)
vnclog.Print(LL_INTINFO, VNCLOG("show per-user Properties\n"));
else
vnclog.Print(LL_INTINFO, VNCLOG("show default system Properties\n"));
// Load in the settings relevant to the user or system
Load(usersettings);
for (;;)
{
m_returncode_valid = FALSE;
// Do the dialog box
int result = DialogBoxParam(hAppInstance,
MAKEINTRESOURCE(IDD_PROPERTIES),
NULL,
(DLGPROC) DialogProc,
(LONG) this);
if (!m_returncode_valid)
result = IDCANCEL;
vnclog.Print(LL_INTINFO, VNCLOG("dialog result = %d\n"), result);
if (result == -1)
{
// Dialog box failed, so quit
PostQuitMessage(0);
return;
}
// We're allowed to exit if the password is not empty
char passwd[MAXPWLEN];
m_server->GetPassword(passwd);
{
vncPasswd::ToText plain(passwd);
if ((strlen(plain) != 0) || !m_server->AuthRequired())
break;
}
vnclog.Print(LL_INTERR, VNCLOG("warning - empty password\n"));
// The password is empty, so if OK was used then redisplay the box,
// otherwise, if CANCEL was used, close down WinVNC
if (result == IDCANCEL)
{
vnclog.Print(LL_INTERR, VNCLOG("no password - QUITTING\n"));
PostQuitMessage(0);
return;
}
//.........这里部分代码省略.........
示例10: SettingsPane
GeneralView::GeneralView(SettingsHost* host)
:
SettingsPane("general", host)
{
BFont statusFont;
// Set a smaller font for the status label
statusFont.SetSize(be_plain_font->Size() * 0.8);
// Status button and label
fServerButton = new BButton("server", kStartServer, new BMessage(kServer));
fStatusLabel = new BStringView("status", kStopped);
fStatusLabel->SetFont(&statusFont);
// Update status label and server button
if (_IsServerRunning()) {
fServerButton->SetLabel(kStopServer);
fStatusLabel->SetText(kStarted);
} else {
fServerButton->SetLabel(kStartServer);
fStatusLabel->SetText(kStopped);
}
// Autostart
fAutoStart = new BCheckBox("autostart",
B_TRANSLATE("Enable notifications at startup"),
new BMessage(kSettingChanged));
// Display time
fTimeout = new BTextControl(B_TRANSLATE("Hide notifications from screen"
" after"), NULL, new BMessage(kSettingChanged));
BStringView* displayTimeLabel = new BStringView("dt_label",
B_TRANSLATE("seconds of inactivity"));
// Default position
// TODO: Here will come a screen representation with the four corners clickable
// Load settings
Load();
// Calculate inset
float inset = ceilf(be_plain_font->Size() * 0.7f);
SetLayout(new BGroupLayout(B_VERTICAL));
AddChild(BGroupLayoutBuilder(B_VERTICAL, inset)
.AddGroup(B_HORIZONTAL, inset)
.Add(fServerButton)
.Add(fStatusLabel)
.AddGlue()
.End()
.AddGroup(B_VERTICAL, inset)
.Add(fAutoStart)
.AddGroup(B_HORIZONTAL)
.AddGroup(B_HORIZONTAL, 2)
.Add(fTimeout)
.Add(displayTimeLabel)
.End()
.End()
.End()
.AddGlue()
);
}
示例11: Load
//==============================================================================
// Brief : エフェクト取得処理
// Return : CEffect* : エフェクトクラス
// Arg : const TCHAR* pNameFile : ファイル名
//==============================================================================
CEffect* CManagerEffect::Get( const TCHAR* pNameFile )
{
// 読み込み
return m_pBufferItem[ Load( pNameFile ) ]->GetEffect();
}
示例12: Initialize
// Constructor
Scanner::Scanner(string fileName)
{
Initialize();
Load(fileName);
}
示例13: dlg
void CImportDialog::Show()
{
wxFileDialog dlg(m_parent, _("Select file to import settings from"), _T(""),
_T("FileZilla.xml"), _T("XML files (*.xml)|*.xml"),
wxFD_OPEN | wxFD_FILE_MUST_EXIST);
dlg.CenterOnParent();
if (dlg.ShowModal() != wxID_OK)
return;
wxFileName fn(dlg.GetPath());
const wxString& path = fn.GetPath();
const wxString& settings = wxGetApp().GetSettingsDir();
if (path == settings)
{
wxMessageBox(_("You cannot import settings from FileZilla's own settings directory."), _("Error importing"), wxICON_ERROR, m_parent);
return;
}
TiXmlDocument* xmlDocument = new TiXmlDocument();
xmlDocument->SetCondenseWhiteSpace(false);
if (!LoadXmlDocument(xmlDocument, dlg.GetPath()))
{
delete xmlDocument;
wxMessageBox(_("Cannot load file, not a valid XML file."), _("Error importing"), wxICON_ERROR, m_parent);
return;
}
TiXmlElement* fz3Root = xmlDocument->FirstChildElement("FileZilla3");
TiXmlElement* fz2Root = xmlDocument->FirstChildElement("FileZilla");
if (fz3Root)
{
bool settings = fz3Root->FirstChildElement("Settings") != 0;
bool queue = fz3Root->FirstChildElement("Queue") != 0;
bool sites = fz3Root->FirstChildElement("Servers") != 0;
if (settings || queue || sites)
{
Load(m_parent, _T("ID_IMPORT"));
if (!queue)
XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->Hide();
if (!sites)
XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->Hide();
if (!settings)
XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->Hide();
Fit();
if (ShowModal() != wxID_OK)
{
delete xmlDocument;
return;
}
if (queue && XRCCTRL(*this, "ID_QUEUE", wxCheckBox)->IsChecked())
{
m_pQueueView->ImportQueue(fz3Root->FirstChildElement("Queue"), true);
}
if (sites && XRCCTRL(*this, "ID_SITEMANAGER", wxCheckBox)->IsChecked())
{
ImportSites(fz3Root->FirstChildElement("Servers"));
}
if (settings && XRCCTRL(*this, "ID_SETTINGS", wxCheckBox)->IsChecked())
{
COptions::Get()->Import(fz3Root->FirstChildElement("Settings"));
wxMessageBox(_("The settings have been imported. You have to restart FileZilla for all settings to have effect."), _("Import successful"), wxOK, this);
}
wxMessageBox(_("The selected categories have been imported."), _("Import successful"), wxOK, this);
delete xmlDocument;
return;
}
}
else if (fz2Root)
{
bool sites_fz2 = fz2Root->FirstChildElement("Sites") != 0;
if (sites_fz2)
{
int res = wxMessageBox(_("The file you have selected contains site manager data from a previous version of FileZilla.\nDue to differences in the storage format, only host, port, username and password will be imported.\nContinue with the import?"),
_("Import data from older version"), wxICON_QUESTION | wxYES_NO);
if (res == wxYES)
ImportLegacySites(fz2Root->FirstChildElement("Sites"));
delete xmlDocument;
return;
}
}
delete xmlDocument;
wxMessageBox(_("File does not contain any importable data."), _("Error importing"), wxICON_ERROR, m_parent);
}
示例14: Load
//******************************************************************************
// Public Interface
//******************************************************************************
void PLAYER::Update(float DeltaTime)
{
if(Data == null) {
Load(DataName);
}
}
示例15: Load
void ae3d::Texture2D::LoadFromAtlas( const FileSystem::FileContentsData& atlasTextureData, const FileSystem::FileContentsData& atlasMetaData, const char* textureName, TextureWrap aWrap, TextureFilter aFilter, float aAnisotropy )
{
Load( atlasTextureData, aWrap, aFilter, mipmaps, aAnisotropy );
const std::string metaStr = std::string( std::begin( atlasMetaData.data ), std::end( atlasMetaData.data ) );
std::stringstream metaStream( metaStr );
if (atlasMetaData.path.find( ".xml" ) == std::string::npos && atlasMetaData.path.find( ".XML" ) == std::string::npos)
{
System::Print("Atlas meta data path %s could not be opened!", atlasMetaData.path.c_str());
return;
}
std::string line;
while (std::getline( metaStream, line ))
{
if (line.find( "<Image Name" ) == std::string::npos)
{
continue;
}
std::vector< std::string > tokens;
Tokenize( line, tokens, "\"" );
bool found = false;
for (std::size_t t = 0; t < tokens.size(); ++t)
{
if (tokens[ t ].find( "Name" ) != std::string::npos)
{
if (tokens[ t + 1 ] == textureName)
{
found = true;
}
}
if (!found)
{
continue;
}
if (tokens[ t ].find( "XPos" ) != std::string::npos)
{
scaleOffset.z = std::stoi( tokens[ t + 1 ] ) / static_cast<float>(width);
}
else if (tokens[ t ].find( "YPos" ) != std::string::npos)
{
scaleOffset.w = std::stoi( tokens[ t + 1 ] ) / static_cast<float>(height);
}
else if (tokens[ t ].find( "Width" ) != std::string::npos)
{
const int w = std::stoi( tokens[ t + 1 ] );
scaleOffset.x = 1.0f / (static_cast<float>(width) / static_cast<float>(w));
width = w;
}
else if (tokens[ t ].find( "Height" ) != std::string::npos)
{
const int h = std::stoi( tokens[ t + 1 ] );
scaleOffset.y = 1.0f / (static_cast<float>(height) / static_cast<float>(h));
height = h;
}
}
if (found)
{
return;
}
}
}