本文整理汇总了C++中mgString::empty方法的典型用法代码示例。如果您正苦于以下问题:C++ mgString::empty方法的具体用法?C++ mgString::empty怎么用?C++ mgString::empty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mgString
的用法示例。
在下文中一共展示了mgString::empty方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GL21getShaderLog
//--------------------------------------------------------------------------
// get shader log error messages as string
void GL21getShaderLog(
GLuint shader,
mgString& logStr)
{
GLint logLen, retLen;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLen);
char* logText = new char[logLen];
glGetShaderInfoLog(shader, logLen, &retLen, logText);
logStr.empty();
logStr.write(logText, retLen);
delete logText;
}
示例2: glGetShaderiv
//--------------------------------------------------------------------------
// return shader log error messages as a string
void mgLinuxGL33Support::getShaderLog(
GLuint shader,
mgString& log)
{
GLint logLen, retLen;
glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &logLen);
char* logText = new char[logLen];
glGetShaderInfoLog(shader, logLen, &retLen, logText);
log.empty();
log.write((const char*) logText, retLen);
delete logText;
}
示例3: parseVar
//--------------------------------------------------------------
// parse a name or value off the strings
int mgErrorTable::parseVar(
mgString& value,
const char* argString,
int posn)
{
value.empty();
while (true)
{
char c = argString[posn++];
if (c == '\0')
return -1;
if (c == MG_ERROR_DELIM)
return posn;
value += c;
}
}
示例4: mgOSResolveRelativeName
//--------------------------------------------------------------
// resolve possibly relative file name.
void mgOSResolveRelativeName(
const char* sourceName,
const char* relName,
mgString& absName)
{
mgString name(relName);
mgOSFixFileName(name);
// if relative name starts with backslash, we're done
if (name.startsWith("\\"))
{
absName = name;
return;
}
// if relative name starts with X: (drive letter), we're done
char letter[MG_MAX_LETTER];
int posn = name.nextLetter(0, letter);
if (posn < name.length())
{
posn = name.nextLetter(posn, letter);
if (strcmp(letter, ":") == 0)
{
absName = name;
return;
}
}
// assume it's really relative. strip last directory in source file
mgString sourceFile(sourceName);
int lastSlash = sourceFile.reverseFind(sourceFile.length(), '\\');
if (lastSlash != -1)
sourceFile.substring(absName, 0, lastSlash+1);
else absName.empty(); // source file has no dir
absName += name;
}
示例5: mgOSResolveRelativeName
//--------------------------------------------------------------
// resolve possibly relative file name.
void mgOSResolveRelativeName(
const char* sourceFile,
const char* relName,
mgString& absName)
{
mgString name(relName);
mgOSFixFileName(name);
// if relative name starts with /, we're done
if (name.startsWith("/"))
{
absName = name;
return;
}
// assume it's really relative. strip last directory in source file
absName = sourceFile;
int lastSlash = absName.reverseFind(absName.length(), "/");
if (lastSlash != -1)
absName.deleteAt(lastSlash+1, absName.length()-(lastSlash+1));
else absName.empty(); // source file has no dir
absName += name;
}