当前位置: 首页>>代码示例>>C++>>正文


C++ Load函数代码示例

本文整理汇总了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));
}
开发者ID:geomview,项目名称:gv2,代码行数:6,代码来源:StorageObject.cpp

示例2: Load

xmlNodePtr HisBase::GetNodePtr()
{
	Load();
	return node;
}
开发者ID:jlola,项目名称:homeis,代码行数:5,代码来源:HisBase.cpp

示例3:

 IDynamicObject& MemoryCache::Access(const std::string& id)
 {
   return *Load(id).content_;
 }
开发者ID:dhanzhang,项目名称:orthanc,代码行数:4,代码来源:MemoryCache.cpp

示例4: return

bool CSG_MetaData::Create(CSG_File &Stream)
{
	return( Load(Stream) );
}
开发者ID:johanvdw,项目名称:SAGA-GIS-git-mirror,代码行数:4,代码来源:metadata.cpp

示例5: Item

Weapon::Weapon(std::string _id, JsonBox::Value& _v, EntityManager* _manager)
	: Item(_id, _v, _manager)
{
	Load(_v, _manager);
}
开发者ID:utilForever,项目名称:SimpleRPG-Text,代码行数:5,代码来源:Weapon.cpp

示例6: xml

	//Metoda ³aduj¹ca dane
	bool CMonsterTemplate::Load(const std::string &name)
	{
		CXml xml(name, "root" );
		return Load(xml);
	}
开发者ID:karlosos,项目名称:Tertius,代码行数:6,代码来源:CMonsterTemplate.cpp

示例7: m_Name

	Texture::Texture(const String& name, const String& filename)
		: m_Name(name), m_FileName(filename)
	{
		m_TID = Load();
	}
开发者ID:Itay2805,项目名称:Sparky4j-core,代码行数:5,代码来源:Texture.cpp

示例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);
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:66,代码来源:GameBase.cpp

示例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;
				}

//.........这里部分代码省略.........
开发者ID:Haxinos,项目名称:metasploit,代码行数:101,代码来源:vncproperties.cpp

示例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()
	);
}
开发者ID:veer77,项目名称:Haiku-services-branch,代码行数:64,代码来源:GeneralView.cpp

示例11: Load

//==============================================================================
// Brief  : エフェクト取得処理
// Return : CEffect*						: エフェクトクラス
// Arg    : const TCHAR* pNameFile			: ファイル名
//==============================================================================
CEffect* CManagerEffect::Get( const TCHAR* pNameFile )
{
	// 読み込み
	return m_pBufferItem[ Load( pNameFile ) ]->GetEffect();
}
开发者ID:mxt819,项目名称:H405,代码行数:10,代码来源:ManagerEffect.cpp

示例12: Initialize

// Constructor
Scanner::Scanner(string fileName)
{
	Initialize();
	Load(fileName);
}
开发者ID:Zanion,项目名称:Logo320Turtles,代码行数:6,代码来源:Scanner.cpp

示例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);
}
开发者ID:ErichKrause,项目名称:filezilla,代码行数:97,代码来源:import.cpp

示例14: Load

//******************************************************************************
// Public Interface
//******************************************************************************
void PLAYER::Update(float DeltaTime)
{
    if(Data == null) {
        Load(DataName);
    }
}
开发者ID:dougfrazer,项目名称:asp,代码行数:9,代码来源:player.cpp

示例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;
        }
    }
}
开发者ID:souxiaosou,项目名称:aether3d,代码行数:69,代码来源:Texture2D_GL45.cpp


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