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


C++ KString::Left方法代码示例

本文整理汇总了C++中KString::Left方法的典型用法代码示例。如果您正苦于以下问题:C++ KString::Left方法的具体用法?C++ KString::Left怎么用?C++ KString::Left使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在KString的用法示例。


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

示例1: ParseHTTPHeaderCommand

void ParseHTTPHeaderCommand(const KString&		s,
							THTTPHeaderCommand&	RCommand)
{
	int i = 0;

	i = s.Find(TEXT(":"));

	if(i == -1)
		RCommand.m_Command = s, RCommand.m_Content = TEXT("");
	else
		RCommand.m_Command = s.Left(i), RCommand.m_Content = s.Mid(i + 1);

	RCommand.m_Command = RCommand.m_Command.Trim();
	RCommand.m_Content = RCommand.m_Content.Trim();
}
开发者ID:tetratec,项目名称:runescape-classic-dump,代码行数:15,代码来源:http.cpp

示例2: Import

bool MeshImportFBX::Import( const char* filename, NVSHARE::MeshImportInterface *callback  )
{
	char message[OUTPUT_TEXT_BUFFER_SIZE+1] = "";
	message[OUTPUT_TEXT_BUFFER_SIZE] = '\0';
	
    const char* localName = getFileName( filename );
	KString fileName = KString( filename );
	KString filePath = fileName.Left( localName - filename );

	m_sdkManager = KFbxSdkManager::Create();

	if(m_sdkManager == NULL)
		return false;


    // Create the importer.
    int fileFormat = -1;
    //int registeredCount;
    //int pluginId;
    //m_sdkManager->GetIOPluginRegistry()->RegisterReader( CreateFBXImporterReader, GetFBXImporterReaderInfo,
    //             pluginId, registeredCount, FillFBXImporterReaderIOSettings );

    m_importer = KFbxImporter::Create( m_sdkManager, "" );
	if( !m_sdkManager->GetIOPluginRegistry()->DetectFileFormat( filename, fileFormat ) )
    {
        // Unrecognizable file format. Try to fall back to KFbxImporter::eFBX_BINARY
        fileFormat = m_sdkManager->GetIOPluginRegistry()->FindReaderIDByDescription( "FBX binary (*.fbx)" );;
    }

    m_importer->SetFileFormat( fileFormat );


    // Initialize the importer by providing a filename.
    if( !m_importer->Initialize( filename ) )
		return false;

    // Create the scene.
    m_scene = KFbxScene::Create( m_sdkManager, "" );


    if (m_importer->IsFBX())
    {
        // Set the import states. By default, the import states are always set to 
        // true. The code below shows how to change these states.
        IOSREF.SetBoolProp(IMP_FBX_MATERIAL,        true);
        IOSREF.SetBoolProp(IMP_FBX_TEXTURE,         true);
        IOSREF.SetBoolProp(IMP_FBX_LINK,            true);
        IOSREF.SetBoolProp(IMP_FBX_SHAPE,           true);
        IOSREF.SetBoolProp(IMP_FBX_GOBO,            true);
        IOSREF.SetBoolProp(IMP_FBX_ANIMATION,       true);
        IOSREF.SetBoolProp(IMP_FBX_GLOBAL_SETTINGS, true);
    }



	sprintf_s( message, OUTPUT_TEXT_BUFFER_SIZE, "Importing file %s", filename );
	outputMessage( message );
	if( !m_importer->Import(m_scene) )
		return false;

	//// Convert Axis System to what is used in this example, if needed
	//KFbxAxisSystem sceneAxisSystem = m_scene->GetGlobalSettings().GetAxisSystem();
	//KFbxAxisSystem ourAxisSystem(sceneAxisSystem.KFbxAxisSystem::ZAxis, KFbxAxisSystem::ParityOdd, KFbxAxisSystem::LeftHanded);
	//if( sceneAxisSystem != ourAxisSystem )
	//{
	//     ourAxisSystem.ConvertScene(m_scene);
	//}

	//// Convert Unit System to what is used in this example, if needed
	//KFbxSystemUnit sceneSystemUnit = m_scene->GetGlobalSettings().GetSystemUnit();
	//if( sceneSystemUnit.GetScaleFactor() != 1.0 )
	//{
	//	
	//    KFbxSystemUnit ourSystemUnit(1.0);
	//	ourSystemUnit.ConvertScene(m_scene);
	//	
	//}

	m_callback = callback;
	
	ImportSkeleton();

	m_takeName = NULL;
	m_takeInfo = NULL;
	m_takeNameArray.Clear();

    int takeCount = m_importer->GetTakeCount();
	int tSelected = -1;

	for(int t = 0; t < takeCount; t++ )
	{
		m_takeInfo = m_importer->GetTakeInfo(t);
		m_takeNameArray.Add( &m_takeInfo->mName );
		if(m_takeInfo->mSelect)
			tSelected = t;
	}        
	if(tSelected == -1 && takeCount > 0)
		tSelected = 0;

	if(tSelected >= 0)
//.........这里部分代码省略.........
开发者ID:GlueFX,项目名称:meshimport,代码行数:101,代码来源:ImportFBX.cpp


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