• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ core::stringc类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中core::stringc的典型用法代码示例。如果您正苦于以下问题:C++ stringc类的具体用法?C++ stringc怎么用?C++ stringc使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了stringc类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: name

bool CSTLMeshWriter::writeMeshASCII(io::IWriteFile* file, scene::IMesh* mesh, s32 flags)
{
	// write STL MESH header

	file->write("solid ",6);
	const core::stringc name(SceneManager->getMeshCache()->getMeshFilename(mesh));
	file->write(name.c_str(),name.size());
	file->write("\n\n",2);

	// write mesh buffers
	
	for (u32 i=0; i<mesh->getMeshBufferCount(); ++i)
	{
		IMeshBuffer* buffer = mesh->getMeshBuffer(i);
		if (buffer)
		{
			const u16 indexCount = buffer->getIndexCount();

			switch(buffer->getVertexType())
			{
			case video::EVT_STANDARD:
				{
					video::S3DVertex* vtx = (video::S3DVertex*)buffer->getVertices();
					for (u32 j=0; j<indexCount; j+=3)
						writeFace(file,
							vtx[buffer->getIndices()[j]].Pos,
							vtx[buffer->getIndices()[j+1]].Pos,
							vtx[buffer->getIndices()[j+2]].Pos);
				}
				break;
			case video::EVT_2TCOORDS:
				{
					video::S3DVertex2TCoords* vtx = (video::S3DVertex2TCoords*)buffer->getVertices();
					for (u32 j=0; j<indexCount; j+=3)
						writeFace(file,
							vtx[buffer->getIndices()[j]].Pos,
							vtx[buffer->getIndices()[j+1]].Pos,
							vtx[buffer->getIndices()[j+2]].Pos);
				}
				break;
			case video::EVT_TANGENTS:
				{
					video::S3DVertexTangents* vtx = (video::S3DVertexTangents*)buffer->getVertices();
					for (u32 j=0; j<indexCount; j+=3)
						writeFace(file,
							vtx[buffer->getIndices()[j]].Pos,
							vtx[buffer->getIndices()[j+1]].Pos,
							vtx[buffer->getIndices()[j+2]].Pos);
				}
				break;
			}
			file->write("\n",1);
		}
	}

	file->write("endsolid ",9);
	file->write(name.c_str(),name.size());

	return true;
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:60,代码来源:CSTLMeshWriter.cpp


示例2: name

bool CSTLMeshWriter::writeMeshASCII(io::IWriteFile* file, scene::IMesh* mesh, s32 flags)
{
	// write STL MESH header

	file->write("solid ",6);
	const core::stringc name(SceneManager->getMeshCache()->getMeshName(mesh));
	file->write(name.c_str(),name.size());
	file->write("\n\n",2);

	// write mesh buffers

	for (u32 i=0; i<mesh->getMeshBufferCount(); ++i)
	{
		IMeshBuffer* buffer = mesh->getMeshBuffer(i);
		if (buffer)
		{
			const u32 indexCount = buffer->getIndexCount();
			for (u32 j=0; j<indexCount; j+=3)
			{
				writeFace(file,
					buffer->getPosition(buffer->getIndices()[j]),
					buffer->getPosition(buffer->getIndices()[j+1]),
					buffer->getPosition(buffer->getIndices()[j+2]));
			}
			file->write("\n",1);
		}
	}

	file->write("endsolid ",9);
	file->write(name.c_str(),name.size());

	return true;
}
开发者ID:Aeshylus,项目名称:Test,代码行数:33,代码来源:CSTLMeshWriter.cpp


示例3: isInSameDirectory

//! looks if file is in the same directory of path. returns offset of directory.
//! 0 means in same directory. 1 means file is direct child of path
		s32 ioutils::isInSameDirectory(const core::stringc& path,
				const core::stringc& file)
		{
			s32 subA = 0;
			s32 subB = 0;
			s32 pos;

			if (path.size() && !path.equalsn(file, path.size()))
				return -1;

			pos = 0;
			while ((pos = path.findFirst('/', pos)) >= 0)
			{
				subA += 1;
				pos += 1;
			}

			pos = 0;
			while ((pos = file.findFirst('/', pos)) >= 0)
			{
				subB += 1;
				pos += 1;
			}

			return subB - subA;
		}
开发者ID:CowPlay,项目名称:irrgame_sdk,代码行数:28,代码来源:ioutils.cpp


示例4: _fullpath

core::stringc CFileSystem::getAbsolutePath(const core::stringc& filename) const
{
	c8 *p=0;

#ifdef _IRR_WINDOWS_API_
	#if !defined ( _WIN32_WCE )
	c8 fpath[_MAX_PATH];
	p = _fullpath( fpath, filename.c_str(), _MAX_PATH);
	#endif

#elif (defined(_IRR_POSIX_API_) || defined(_IRR_OSX_PLATFORM_))
	c8 fpath[4096];
	fpath[0]=0;
	p = realpath(filename.c_str(), fpath);
	if (!p)
	{
		// content in fpath is undefined at this point
		if ('0'==fpath[0]) // seems like fpath wasn't altered
		{
			// at least remove a ./ prefix
			if ('.'==filename[0] && '/'==filename[1])
				return filename.subString(2, filename.size()-2);
			else
				return filename;
		}
		else
			return core::stringc(fpath);
	}

#endif

	return core::stringc(p);
}
开发者ID:AwkwardDev,项目名称:pseuwow,代码行数:33,代码来源:CFileSystem.cpp


示例5: getNextToken

//! read the next token from file
void CImageLoaderPPM::getNextToken(io::IReadFile* file, core::stringc& token) const
{
	token = "";
	c8 c;
	while(file->getPos()<file->getSize())
	{
		file->read(&c, 1);
		if (c=='#')
		{
			while (c!='\n' && c!='\r' && (file->getPos()<file->getSize()))
				file->read(&c, 1);
		}
		else if (!core::isspace(c))
		{
			token.append(c);
			break;
		}
	}
	while(file->getPos()<file->getSize())
	{
		file->read(&c, 1);
		if (c=='#')
		{
			while (c!='\n' && c!='\r' && (file->getPos()<file->getSize()))
				file->read(&c, 1);
		}
		else if (!core::isspace(c))
			token.append(c);
		else
			break;
	}
}
开发者ID:Lumirion,项目名称:pseuwow,代码行数:33,代码来源:CImageLoaderPPM.cpp


示例6: getStat

s32 PlayerManager::getStatAsInteger(const core::stringw& key) const
{
    const core::stringc s = getStat(key);
    if (s.empty())
        return 0;
    
    return core::strtol10(s.c_str());
}
开发者ID:AdrienBourgois,项目名称:EternalSonata,代码行数:8,代码来源:XMLmanager.cpp


示例7: getFileBasename

//! returns the base part of a filename, i.e. all except for the directory
//! part. If no directory path is prefixed, the full name is returned.
core::stringc CFileSystem::getFileBasename(const core::stringc& filename, bool keepExtension) const
{
    // find last forward or backslash
    s32 lastSlash = filename.findLast('/');
    const s32 lastBackSlash = filename.findLast('\\');
    lastSlash = core::max_(lastSlash, lastBackSlash);

    // get number of chars after last dot
    s32 end = 0;
    if (!keepExtension)
    {
        // take care to search only after last slash to check only for
        // dots in the filename
        end = filename.findLast('.', lastSlash);
        if (end == -1)
            end=0;
        else
            end = filename.size()-end;
    }

    if ((u32)lastSlash < filename.size())
        return filename.subString(lastSlash+1, filename.size()-lastSlash-1-end);
    else if (end != 0)
        return filename.subString(0, filename.size()-end);
    else
        return filename;
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:29,代码来源:CFileSystem.cpp


示例8: GetContextPathFromFilename

core::stringc GetContextPathFromFilename( const core::stringc& filename )
{
    core::stringc path;
    s32 i=filename.size()-1;
    while ( i >= 0 && filename[i] != '/' )
    {
        i--;
    }
    path = filename.subString( 0, i+1 );
    return path;
}
开发者ID:huytd,项目名称:fosengine,代码行数:11,代码来源:SkinLoader.cpp


示例9: getFileDir

//! returns the directory part of a filename, i.e. all until the first
//! slash or backslash, excluding it. If no directory path is prefixed, a '.'
//! is returned.
core::stringc CFileSystem::getFileDir(const core::stringc& filename) const
{
	// find last forward or backslash
	s32 lastSlash = filename.findLast('/');
	const s32 lastBackSlash = filename.findLast('\\');
	lastSlash = lastSlash > lastBackSlash ? lastSlash : lastBackSlash;

	if ((u32)lastSlash < filename.size())
		return filename.subString(0, lastSlash);
	else
		return ".";
}
开发者ID:AwkwardDev,项目名称:pseuwow,代码行数:15,代码来源:CFileSystem.cpp


示例10: isanimesh

bool FileSceneNode::isanimesh(core::stringc name) {
    if ((name.subString(name.size() - 4, 4).equals_ignore_case(".md2")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".md3")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".obj")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".bsp")) ||
            (name.subString(name.size() - 5, 5).equals_ignore_case(".my3d")) ||
            (name.subString(name.size() - 5, 5).equals_ignore_case(".lmts")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".csm")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".oct")))
        return true;
    return false;
}
开发者ID:echoline,项目名称:IrrGUI,代码行数:12,代码来源:FileSceneNode.cpp


示例11:

//! sets the caption of the window
void CIrrDeviceWin32::setWindowCaption(const wchar_t* text)
{
	DWORD dwResult;
	if (IsNonNTWindows)
	{
		const core::stringc s = text;
		SendMessageTimeout(HWnd, WM_SETTEXT, 0,
				reinterpret_cast<LPARAM>(s.c_str()),
				SMTO_ABORTIFHUNG, 2000, &dwResult);
	}
	else
		SendMessageTimeoutW(HWnd, WM_SETTEXT, 0,
				reinterpret_cast<LPARAM>(text),
				SMTO_ABORTIFHUNG, 2000, &dwResult);
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:16,代码来源:CIrrDeviceWin32.cpp


示例12: deletePathFromFilename

//! deletes the path from a filename
void CPakReader::deletePathFromFilename(core::stringc& filename)
{
	// delete path from filename
	const c8* p = filename.c_str() + filename.size();

	// search for path separator or beginning

	while (*p!='/' && *p!='\\' && p!=filename.c_str())
		--p;

	if (p != filename.c_str())
	{
		++p;
		filename = p;
	}
}
开发者ID:jivibounty,项目名称:irrlicht,代码行数:17,代码来源:CPakReader.cpp


示例13:

//!
const c8* CTestSceneNode::getSceneCorePropertiesXMLString()
{
	static core::stringc xmlstr;
	xmlstr = "";

	if (getMaterialsCount() == 1)
	{
		const c8* mat_xml = SCENE_MANAGER.getMaterialXMLText(getMaterial(0));
		xmlstr.append(mat_xml);
	}

	xmlstr.sprintf("<GeomPrimitive type=\"%s\" />\n",
		GeomPrimitiveTypeStr[m_GeomPrimitiveType]);

	return xmlstr.c_str();
}
开发者ID:zdementor,项目名称:my-base,代码行数:17,代码来源:CTestSceneNode.cpp


示例14: Device

CShaderMaterial::CShaderMaterial(IrrlichtDevice* device, const core::stringc& name,
		io::path vsFile, core::stringc vsEntry, video::E_VERTEX_SHADER_TYPE vsType,
		io::path psFile, core::stringc psEntry, video::E_PIXEL_SHADER_TYPE psType,
		video::E_MATERIAL_TYPE baseMaterial) : Device(device), Name(name), PixelShaderFlags(0), VertexShaderFlags(0)
{
	s32 userdata = 0;
	io::path vsPath;
	io::path psPath;

	// log action
	core::stringc msg = core::stringc("compiling material ") + name;
	Device->getLogger()->log(msg.c_str(), ELL_INFORMATION);

	// create destination path for (driver specific) shader files
	if(Device->getVideoDriver()->getDriverType() == video::EDT_OPENGL)
	{
		vsPath = core::stringc("./shaders/glsl/") + vsFile;
		psPath = core::stringc("./shaders/glsl/") + psFile;
		userdata = 1;
	}
	if(Device->getVideoDriver()->getDriverType() == video::EDT_DIRECT3D9)
	{
		vsPath=core::stringc("./shaders/hlsl/") + vsFile;
		psPath=core::stringc("./shaders/hlsl/") + psFile;
		userdata = 0;
	}

	// create shader material
	video::IGPUProgrammingServices* gpu = Device->getVideoDriver()->getGPUProgrammingServices();
	s32 matID = gpu->addHighLevelShaderMaterialFromFiles(
			vsPath, vsEntry.c_str(), vsType,
			psPath, psEntry.c_str(), psType,
			this, baseMaterial,	userdata);

	// set material type
	Material.MaterialType = (video::E_MATERIAL_TYPE)matID;

	// set the default texturenames and texture wrap
	// these are overridden by the effect.xml configuration
	for (u32 i=0; i<video::MATERIAL_MAX_TEXTURES; ++i)
	{
		TextureName[i] = core::stringc("texture") + core::stringc(i);
		Material.TextureLayer[i].TextureWrapU = video::ETC_REPEAT;
		Material.TextureLayer[i].TextureWrapV = video::ETC_REPEAT;
	}
}
开发者ID:RealBadAngel,项目名称:terrainTest,代码行数:46,代码来源:ShaderMaterial.cpp


示例15: isimg

bool FileSceneNode::isimg(core::stringc name) {
    if ((name.subString(name.size() - 4, 4).equals_ignore_case(".bmp")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".jpg")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".tga")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".pcx")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".png")) ||
            (name.subString(name.size() - 4, 4).equals_ignore_case(".psd")))
        return true;
    return false;
}
开发者ID:echoline,项目名称:IrrGUI,代码行数:10,代码来源:FileSceneNode.cpp


示例16: while

//! deletes the path from a filename
void CPakReader::deletePathFromFilename(core::stringc& filename)
{
	// delete path from filename
	const c8* p = filename.c_str() + filename.size();

	// suche ein slash oder den anfang.

	while (*p!='/' && *p!='\\' && p!=filename.c_str())
		--p;

	core::stringc newName;

	if (p != filename.c_str())
	{
		++p;
		filename = p;
	}
}
开发者ID:JJHOCK,项目名称:l2adenalib,代码行数:19,代码来源:CPakReader.cpp


示例17: readString

void CNPKReader::readString(core::stringc& name)
{
	short stringSize;
	char buf[256];
	File->read(&stringSize, 2);
#ifdef __BIG_ENDIAN__
	stringSize = os::Byteswap::byteswap(stringSize);
#endif
	name.reserve(stringSize);
	while(stringSize)
	{
		const short next = core::min_(stringSize, (short)255);
		File->read(buf,next);
		buf[next]=0;
		name.append(buf);
		stringSize -= next;
	}
}
开发者ID:EEmmanuel7,项目名称:irrlicht-android-1,代码行数:18,代码来源:CNPKReader.cpp


示例18: resRoot

Address::Address(core::stringc addr, core::stringc port)
: resRoot(0), resActive(0)
{
	Startup();
	struct addrinfo hints;
	memset(&hints, 0, sizeof(hints));
	hints.ai_family = AF_INET;
	hints.ai_protocol = SOCK_STREAM;
	int error = 0;
	error = getaddrinfo(addr.c_str(), port.c_str() , &hints, &resRoot);
	if(error)
	{
		printf("getaddrinfo failed... %s %s %s\n", addr.c_str(), port.c_str(), gai_strerror(error));
		freeaddrinfo(resRoot);
		resRoot = resActive = 0;
		return;
	}
};
开发者ID:JJHOCK,项目名称:l2adenalib,代码行数:18,代码来源:irrAddress.cpp


示例19: stringc

core::stringc CMS3DMeshFileLoader::stripPathFromString(const core::stringc& inString, bool returnPath) const
{
	s32 slashIndex=inString.findLast('/'); // forward slash
	s32 backSlash=inString.findLast('\\'); // back slash

	if (backSlash>slashIndex) slashIndex=backSlash;

	if (slashIndex==-1)//no slashes found
	{
		if (returnPath)
			return core::stringc(); //no path to return
		else
			return inString;
	}

	if (returnPath)
		return inString.subString(0, slashIndex + 1);
	else
		return inString.subString(slashIndex+1, inString.size() - (slashIndex+1));
}
开发者ID:344717871,项目名称:STK_android,代码行数:20,代码来源:CMS3DMeshFileLoader.cpp


示例20: getConfigForGamepad

/**
 * Check if we already have a config object for gamepad 'irr_id' as reported by
 * irrLicht, If no, create one. Returns true if new configuration was created,
 *  otherwise false.
 */
bool DeviceManager::getConfigForGamepad(const int irr_id,
                                        const core::stringc& name,
                                        GamepadConfig **config)
{
    bool found = false;
    bool configCreated = false;

    // Find appropriate configuration
    for(unsigned int n=0; n < m_gamepad_configs.size(); n++)
    {
        if(m_gamepad_configs[n].getName() == name.c_str())
        {
            *config = m_gamepad_configs.get(n);
            found = true;
        }
    }

    // If we can't find an appropriate configuration then create one.
    if (!found)
    {
        if(irr_id < (int)(m_irrlicht_gamepads.size()))
        {
            *config = new GamepadConfig( name.c_str(),
                                         m_irrlicht_gamepads[irr_id].Axes,
                                         m_irrlicht_gamepads[irr_id].Buttons );
        }
#ifdef ENABLE_WIIUSE
        else    // Wiimotes have a higher ID and do not refer to m_irrlicht_gamepads
        {
            // The Wiimote manager will set number of buttons and axis
            *config = new GamepadConfig(name.c_str());
        }
#endif

        // Add new config to list
        m_gamepad_configs.push_back(*config);
        configCreated = true;
    }

    return configCreated;
}
开发者ID:Berulacks,项目名称:stk-code,代码行数:46,代码来源:device_manager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ core::stringw类代码示例发布时间:2022-05-31
下一篇:
C++ core::string类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap