本文整理汇总了C++中gkString::find方法的典型用法代码示例。如果您正苦于以下问题:C++ gkString::find方法的具体用法?C++ gkString::find怎么用?C++ gkString::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gkString
的用法示例。
在下文中一共展示了gkString::find方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTok
bool getTok(const gkString& buf, const gkString& dim, gkString& tok, size_t &start)
{
const size_t size = buf.size();
const size_t dimsize = dim.size();
size_t pos = gkString::npos;
while (start < size)
{
pos = buf.find(dim, start);
if (pos == gkString::npos)
pos = size;
if (start == pos)
start += dimsize;
else
break;
}
if (start >= size) return false;
tok.assign(&buf[start], pos-start);
start = pos + dimsize;
return true;
}
示例2: getTextType
int gkTextManager::getTextType(const gkString& name)
{
int i = 0;
while (TextItemMap[i].name != 0)
{
if (name.find(TextItemMap[i].name) != name.npos)
return TextItemMap[i].type;
++i;
}
return TT_ANY;
}
示例3: collidesWith
bool gkPhysicsController::collidesWith(const gkString& name, gkContactInfo* cpy, bool emptyFilter)
{
if (!m_localContacts.empty())
{
if (name.empty() && emptyFilter)
{
if (cpy) *cpy = m_localContacts.at(0);
return true;
}
UTsize i, s;
gkContactInfo::Array::Pointer p;
i = 0;
s = m_localContacts.size();
p = m_localContacts.ptr();
while (i < s)
{
GK_ASSERT(p[i].collider);
gkGameObject* gobj = p[i].collider->getObject();
if (name.find(gobj->getName()) != gkString::npos)
{
if (cpy) *cpy = p[i];
return true;
}
++i;
}
}
return false;
}
示例4: setup
//.........这里部分代码省略.........
cmdl.add(vsync_arg);
cmdl.add(vsyncrate_arg);
cmdl.add(debugPhysicsAabb_arg);
cmdl.add(buildStaticGeometry_arg);
cmdl.add(useBulletDbvt_arg);
cmdl.add(showDebugProps_arg);
cmdl.add(debugSounds_arg);
cmdl.add(disableSound_arg);
cmdl.add(fsaa_arg);
cmdl.add(fsaaSamples_arg);
cmdl.add(enableshadows_arg);
cmdl.add(defaultMipMap_arg);
cmdl.add(shadowtechnique_arg);
cmdl.add(colourshadow_arg);
cmdl.add(fardistanceshadow_arg);
cmdl.add(shaderCachePath_arg);
//input file arguments
TCLAP::ValueArg<std::string> cfgfname_arg("c", "config-file", "Startup configuration file (.cfg) to use.", false, gkDefaultConfig, "string");
TCLAP::UnlabeledValueArg<std::string> bfname_arg("blender-file", "Blender file to launch as game.", false, gkDefaultBlend, "string");
cmdl.add(cfgfname_arg);
cmdl.add(bfname_arg);
cmdl.parse( argc, argv );
cfgfname = cfgfname_arg.getValue();
m_blend = bfname_arg.getValue();
m_prefs.rendersystem = gkUserDefs::getOgreRenderSystem(rendersystem_arg.getValue());
m_prefs.viewportOrientation = viewportOrientation_arg.getValue();
//m_prefs.sceneManager = sceneManager_arg.getValue();
m_prefs.log = log_arg.getValue();
m_prefs.verbose = verbose_arg.getValue();
m_prefs.winsize = gkVector2(winsize_x_arg.getValue(), winsize_y_arg.getValue());
m_prefs.wintitle = wintitle_arg.getValue();
m_prefs.fullscreen = fullscreen_arg.getValue();
m_prefs.framingType = gkUserDefs::getViewportFramingType(framingType_arg.getValue());
m_prefs.resources = resources_arg.getValue();
m_prefs.blendermat = blendermat_arg.getValue();
m_prefs.matblending = matblending_arg.getValue();
m_prefs.grabInput = grapInput_arg.getValue();
m_prefs.debugFps = debugFps_arg.getValue();
m_prefs.debugPhysics = debugPhysics_arg.getValue();
m_prefs.debugPhysicsAabb = debugPhysicsAabb_arg.getValue();
m_prefs.buildStaticGeometry = buildStaticGeometry_arg.getValue();
m_prefs.useBulletDbvt = useBulletDbvt_arg.getValue();
m_prefs.showDebugProps = showDebugProps_arg.getValue();
m_prefs.debugSounds = debugSounds_arg.getValue();
m_prefs.disableSound = disableSound_arg.getValue();
m_prefs.vsync = vsync_arg.getValue();
m_prefs.vsyncRate = vsyncrate_arg.getValue();
m_prefs.fsaa = fsaa_arg.getValue();
m_prefs.fsaaSamples = fsaaSamples_arg.getValue();
m_prefs.enableshadows = enableshadows_arg.getValue();
m_prefs.defaultMipMap = defaultMipMap_arg.getValue();
m_prefs.shadowtechnique = shadowtechnique_arg.getValue();
m_prefs.fardistanceshadow = fardistanceshadow_arg.getValue();
m_prefs.shaderCachePath = shaderCachePath_arg.getValue();
if (colourshadow_arg.isSet())
m_prefs.colourshadow = Ogre::StringConverter::parseColourValue(colourshadow_arg.getValue());
#ifdef __APPLE__
if (m_blend.find("-psn") != gkString::npos)
m_blend = gkDefaultBlend;
#endif
}
catch (TCLAP::ArgException& e)
{
std::cerr << "error: " << e.error() << " for arg " << e.argId() << std::endl;
return -1;
}
catch (TCLAP::ExitException&)
{
// just return and exit app
return -1;
}
catch (...)
{
std::cerr << "Unknown exception." << std::endl;
return -1;
}
gkPath path = cfgfname;
// overide settings if found
if (path.isFile())
m_prefs.load(path.getPath());
return 0;
}