本文整理汇总了C++中NzString::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ NzString::GetSize方法的具体用法?C++ NzString::GetSize怎么用?C++ NzString::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NzString
的用法示例。
在下文中一共展示了NzString::GetSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetSource
void NzShaderStage::SetSource(const NzString& source)
{
#if NAZARA_RENDERER_SAFE
if (!m_id)
{
NazaraError("Shader stage is not initialized");
return;
}
#endif
const char* tmp = source.GetConstBuffer();
GLint length = source.GetSize();
glShaderSource(m_id, 1, &tmp, &length);
}
示例2: Mount
bool NzPluginManager::Mount(const NzString& pluginPath, bool appendExtension)
{
if (!Initialize())
{
NazaraError("Failed to initialize PluginManager");
return false;
}
NzString path = pluginPath;
if (appendExtension && !path.EndsWith(NAZARA_DYNLIB_EXTENSION))
path += NAZARA_DYNLIB_EXTENSION;
bool exists = false;
if (!NzFile::IsAbsolute(path))
{
for (const NzString& dir : s_directories)
{
NzString testPath;
testPath.Reserve(dir.GetSize() + path.GetSize() + 10);
testPath = dir;
testPath += NAZARA_DIRECTORY_SEPARATOR;
testPath += path;
if (NzFile::Exists(testPath))
{
path = testPath;
exists = true;
break;
}
}
}
else if (NzFile::Exists(path))
exists = true;
if (!exists)
{
NazaraError("Failed to find plugin file");
return false;
}
std::unique_ptr<NzDynLib> library(new NzDynLib);
if (!library->Load(path))
{
NazaraError("Failed to load plugin");
return false;
}
PluginLoad func = reinterpret_cast<PluginLoad>(library->GetSymbol("NzPluginLoad"));
if (!func)
{
NazaraError("Failed to get symbol NzPluginLoad");
return false;
}
if (!func())
{
NazaraError("Plugin failed to load");
return false;
}
s_plugins[pluginPath] = library.release();
return true;
}
示例3: PushString
void NzLuaInstance::PushString(const NzString& str)
{
lua_pushlstring(m_state, str.GetConstBuffer(), str.GetSize());
}
示例4:
NzStringStream::NzStringStream(const NzString& str) :
m_bufferSize(str.GetSize())
{
m_strings.push_back(str);
}