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


C++ CFileStream类代码示例

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


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

示例1: PrepareSimpleDialog

void CRIFFChunkTreeDlg::OnSave() 
{
	OPENFILENAME ofn;

	PrepareSimpleDialog(&ofn, *this, "*.txt");
	ofn.lpstrFilter = "Text files (*.txt)|*.txt||";
	ofn.Flags |= OFN_OVERWRITEPROMPT;
	if (!GetOpenSaveFileNameUTF8(&ofn, false)) 
		return;

	CFileStream* destFile = new CFileStream();
	if (STREAM_OK == destFile->Open(ofn.lpstrFile, StreamMode::Write))
	{
		CACHE* cache = new CACHE(4, 1<<18);
		cache->Open(destFile, CACHE_OPEN_WRITE);
		cache->Write(cUTF8Hdr, 3);

		RenderItem(cache, m_Tree.GetRootItem(), 0);

		cache->Close();
		delete cache;
		destFile->Close();
		delete destFile;
	}
	else
	{
		MessageBoxHelper::CouldNotOpenFileForWrite(ofn.lpstrFile);
	}
}
开发者ID:BrunoReX,项目名称:avimuxgui,代码行数:29,代码来源:RIFFChunkTreeDlg.cpp

示例2: LoadSource

//////////////////////////////////////////////////////////////////////
// CShader
//////////////////////////////////////////////////////////////////////
bool CShader::LoadSource(const std::string& filename, const std::string& prefix)
{
  if(filename.empty())
    return true;

  CFileStream file;

  std::string path = "special://xbmc/system/shaders/";
  path += CServiceBroker::GetRenderSystem()->GetShaderPath(filename);
  path += filename;
  if(!file.Open(path))
  {
    CLog::Log(LOGERROR, "CYUVShaderGLSL::CYUVShaderGLSL - failed to open file %s", filename.c_str());
    return false;
  }
  getline(file, m_source, '\0');

  size_t pos = 0;
  size_t versionPos = m_source.find("#version");
  if (versionPos != std::string::npos)
  {
    versionPos = m_source.find("\n", versionPos);
    if (versionPos != std::string::npos)
      pos = versionPos + 1;
  }
  m_source.insert(pos, prefix);
  return true;
}
开发者ID:soerendd,项目名称:xbmc,代码行数:31,代码来源:Shader.cpp

示例3: Load

bool CDungeonConfig::Load(CFileStream&file)
{
    file.ReadUInt( m_nDungeonID );

    short nCount = 0;
    file.ReadShort(nCount) ;
    file.ReadString(m_strDungeonName, nCount);

    file.ReadShort(nCount) ;
    file.ReadString(m_strIconName, nCount);

    file.ReadShort(nCount) ;
    file.ReadString(m_strIconAtlas, nCount);

    file.ReadUInt(m_nStoryID);
    unsigned short nParcloseCount = 0;
    file.ReadUShort( nParcloseCount );
    for ( unsigned int i  = 0 ;i <  nParcloseCount; ++i )
    {
        unsigned int nParcloseID = 0;
        file.ReadUInt( nParcloseID );
        m_ParcloseList.push_back( nParcloseID );
    }

    return true;
}
开发者ID:yzfrs,项目名称:ddianle_d1,代码行数:26,代码来源:MagicLampConfig.cpp

示例4: InsertSource

bool CShader::InsertSource(const std::string& filename, const std::string& loc)
{
  if(filename.empty())
    return true;

  CFileStream file;
  std::string temp;

  std::string path = "special://xbmc/system/shaders/";
  path += CServiceBroker::GetRenderSystem()->GetShaderPath(filename);
  path += filename;
  if(!file.Open(path))
  {
    CLog::Log(LOGERROR, "CShader::InsertSource - failed to open file %s", filename.c_str());
    return false;
  }
  getline(file, temp, '\0');

  size_t locPos = m_source.find(loc);
  if (locPos == std::string::npos)
  {
    CLog::Log(LOGERROR, "CShader::InsertSource - could not find location %s", loc.c_str());
    return false;
  }

  m_source.insert(locPos, temp);

  return true;
}
开发者ID:soerendd,项目名称:xbmc,代码行数:29,代码来源:Shader.cpp

示例5: new

CFileStream* CFileStream::NewL(TDesC& aFileName, TBool aIsWrite) 
	{
	CFileStream* r = new(ELeave) CFileStream(aIsWrite);
	CleanupStack::PushL(r);
	r->ConstructL(aFileName);
	CleanupStack::Pop();
	return r;
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:8,代码来源:filestream.cpp

示例6: SavePRM

//???remove from here? make user use readers/writers directly?
void CDataServer::SavePRM(const nString& FileName, PParams Content)
{
	if (!Content.isvalid()) return;

	CFileStream File;
	if (!File.Open(FileName, SAM_WRITE)) return;
	CBinaryWriter Writer(File);
	Writer.WriteParams(*Content);
}
开发者ID:moltenguy1,项目名称:deusexmachina,代码行数:10,代码来源:DataServer.cpp

示例7: SaveMeshToFile

void CGlobalMshLoader::SaveMeshToFile(const CMesh::TMeshContainer &mesh, const nstring &file)
{
	CFileStream sfile;

	sfile.Open(file, true, false);
	SaveMeshToStream(mesh, &sfile);

	sfile.Close();
}
开发者ID:Siriuscoder,项目名称:NovaEngine,代码行数:9,代码来源:nova_msh_loader.cpp

示例8: main

int main(int argc, char* argv[])
{
	
	CFileStream stream;
	stream.open("./test.txt","wb+");
	stream.write("aaa", 3);
	stream.close();

	return 0;
}
开发者ID:xianjimli,项目名称:misc,代码行数:10,代码来源:FileStream.cpp

示例9: LoadFromFile

void CLuckDrawPrizeBase::LoadFromFile(CFileStream &file)
{
    // Factory loads m_nType outside.
    file.ReadUChar(m_nLevel);
    file.ReadUChar(m_nSexNeed);
    file.ReadBool(m_bAnnounce);

    ASSERT(m_nType < ELuckDrawPrizeType_Max);
    ASSERT(m_nLevel < ELuckDrawPrizeLevel_Max);
    ASSERT(m_nSexNeed < ESexType_Max);
}
开发者ID:yzfrs,项目名称:ddianle_d1,代码行数:11,代码来源:LuckDrawPrizeBase.cpp

示例10:

CMesh::TMeshContainer &CGlobalMshLoader::LoadMeshFromFile(const nstring &file)
{
	CFileStream sfile;
	
	sfile.Open(file);
	LoadMeshFromStream(&sfile);

	sfile.Close();

	return gMeshBuffer;
}
开发者ID:Siriuscoder,项目名称:NovaEngine,代码行数:11,代码来源:nova_msh_loader.cpp

示例11: strFileName

void CMedalCfgMgr::LoadConfigFromFile()
{
    std::string strFileName( g_sPath );
    strFileName.append( MEDAL_FILE_NAME );

    CFileStream file;
    file.open( strFileName.c_str(), "rb" );

    LoadMedalConfigFromFile( file );
    LoadProgressConfigFromFile( file );

    file.close();
}
开发者ID:yzfrs,项目名称:ddianle_d1,代码行数:13,代码来源:MedalCfgMgr.cpp

示例12: CFileStream

    bool CDocument::SaveToFile(const std::wstring& wsPath)
	{
		CFileStream* pStream = new CFileStream();
		if (!pStream || !pStream->OpenFile(wsPath, true))
			return false;

		if (m_pJbig2)
			m_pJbig2->FlushStreams();

		SaveToStream((CStream*)pStream);
		delete pStream;

		return true;
	}
开发者ID:ONLYOFFICE,项目名称:core,代码行数:14,代码来源:Document.cpp

示例13: Save

bool CThemeParcloseConfig::Save(CFileStream & file)
{
    file.WriteUInt(m_nThemeID);
    CParcloseConfig::Save(file);

    return true;
}
开发者ID:yzfrs,项目名称:ddianle_d1,代码行数:7,代码来源:MagicLampConfig.cpp

示例14: LoadSource

//////////////////////////////////////////////////////////////////////
// CShader
//////////////////////////////////////////////////////////////////////
bool CShader::LoadSource(const string& filename, const string& prefix)
{
  if(filename.empty())
    return true;

  CFileStream file;

  if(!file.Open("special://xbmc/system/shaders/" + filename))
  {
    CLog::Log(LOGERROR, "CYUVShaderGLSL::CYUVShaderGLSL - failed to open file %s", filename.c_str());
    return false;
  }
  getline(file, m_source, '\0');
  m_source.insert(0, prefix);
  return true;
}
开发者ID:2BReality,项目名称:xbmc,代码行数:19,代码来源:Shader.cpp

示例15: AppendSource

bool CShader::AppendSource(const string& filename)
{
  if(filename.empty())
    return true;

  CFileStream file;
  string temp;

  if(!file.Open("special://xbmc/system/shaders/" + filename))
  {
    CLog::Log(LOGERROR, "CShader::AppendSource - failed to open file %s", filename.c_str());
    return false;
  }
  getline(file, temp, '\0');
  m_source.append(temp);
  return true;
}
开发者ID:beermix,项目名称:xbmc,代码行数:17,代码来源:Shader.cpp


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