您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ FilePath函数代码示例

51自学网 2021-06-01 20:46:07
  C++
这篇教程C++ FilePath函数代码示例写得很实用,希望能帮到您。

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

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

示例1: luaFuncResources

static int luaFuncResources(lua_State* l){    Block* b = mbGetActiveContext()->ActiveBlock();	if (!b)	{		MB_LOGERROR("must be within a block");		mbExitError();	}	    luaL_checktype(l, 1, LUA_TTABLE);    int tableLen =  luaL_len(l, 1);    	FilePathVector strings;    for (int i = 1; i <= tableLen; ++i)    {        lua_rawgeti(l, 1, i);		strings.push_back(FilePath());		mbLuaToStringExpandMacros(&strings.back(), b, l, -1);	}		StringVector filteredList;	BuildFileList(&filteredList, strings);	b->AddResources(filteredList);    return 0;}
开发者ID:kjmac123,项目名称:metabuilder,代码行数:25,


示例2: clang

void TranslationUnit::printResourceUsage(std::ostream& ostr, bool detailed) const{   CXTUResourceUsage usage = clang().getCXTUResourceUsage(tu_);   unsigned long totalBytes = 0;   for (unsigned i = 0; i < usage.numEntries; i++)   {      CXTUResourceUsageEntry entry = usage.entries[i];      if (detailed)      {         ostr << clang().getTUResourceUsageName(entry.kind) << ": "              << formatBytes(entry.amount) << std::endl;      }      if (entry.kind >= CXTUResourceUsage_MEMORY_IN_BYTES_BEGIN &&          entry.kind <= CXTUResourceUsage_MEMORY_IN_BYTES_END)      {         totalBytes += entry.amount;      }   }   ostr << "TOTAL MEMORY: " << formatBytes(totalBytes)        << " (" << FilePath(getSpelling()).filename() << ")" << std::endl;   clang().disposeCXTUResourceUsage(usage);}
开发者ID:rstudio,项目名称:rstudio,代码行数:26,


示例3: switch

			void RegularFile::Open(OpenMode::Mode mode) {				int flags = 0;				switch (mode) {					case OpenMode::Read:						flags = 0;						m_FD->Eof = false;						break;					case OpenMode::Write:						flags = O_CREAT|O_WRONLY|O_TRUNC;						break;					case OpenMode::Append:						flags = O_CREAT|O_WRONLY|O_APPEND;						break;					default:						throw Ape::EInvalidArgument("Invalid OpenMode");						break;				}				m_FD->FD = open(FilePath().Canonical().CStr(), flags);				//printf("%s -> %p/n", FilePath().Canonical().CStr(), m_FD->FD);								if (m_FD->FD == -1) {					ThrowExceptionFor(errno);				}				m_Mode = mode;			}
开发者ID:RGafiyatullin,项目名称:ApeLibs,代码行数:25,


示例4: dir

// Given directory = "dir", relative_path = "test.xml", returns "dir/test.xml".// On Windows, uses / as the separator rather than /.FilePath FilePath::ConcatPaths(const FilePath& directory,                               const FilePath& relative_path) {  if (directory.IsEmpty())    return relative_path;  const FilePath dir(directory.RemoveTrailingPathSeparator());  return FilePath(dir.string() + kPathSeparator + relative_path.string());}
开发者ID:wllxyz,项目名称:study,代码行数:9,


示例5: FilePath

FilePath AddGenCompDialog::getSelectedGenCompFilePath() const noexcept{    if (mSelectedGenComp)        return mSelectedGenComp->getDirectory();    else        return FilePath();}
开发者ID:nemofisch,项目名称:LibrePCB,代码行数:7,


示例6: switch

FilePath MipMapReplacer::GetDummyTextureFilePath(Texture * texture){    String formatFile;    switch (texture->format)    {    case FORMAT_ATC_RGB:        formatFile = "atc.dds";        break;    case FORMAT_ATC_RGBA_EXPLICIT_ALPHA:        formatFile = "atce.dds";        break;    case FORMAT_ATC_RGBA_INTERPOLATED_ALPHA:        formatFile = "atci.dds";        break;    case FORMAT_DXT1:        formatFile = "dxt1.dds";        break;    case FORMAT_DXT1A:        formatFile = "dxt1a.dds";        break;    case FORMAT_DXT1NM:        formatFile = "dxt1nm.dds";        break;    case FORMAT_DXT3:        formatFile = "dxt3.dds";        break;    case FORMAT_DXT5:        formatFile = "dxt5.dds";        break;    case FORMAT_DXT5NM:        formatFile = "dxt5nm.dds";        break;    case FORMAT_ETC1:        formatFile = "etc1.pvr";        break;    case FORMAT_PVR2:        formatFile = "pvr2.pvr";        break;    case FORMAT_PVR4:        formatFile = "pvr4.pvr";        break;    default:        return FilePath();    }    return FilePath(DUMMY_TEXTURES_DIR + formatFile);}
开发者ID:droidenko,项目名称:dava.framework,代码行数:47,


示例7: FilePath

// Returns a copy of the FilePath with the case-insensitive extension removed.// Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns// FilePath("dir/file"). If a case-insensitive extension is not// found, returns a copy of the original FilePath.FilePath FilePath::RemoveExtension(const char* extension) const {  const std::string dot_extension = std::string(".") + extension;  if (String::EndsWithCaseInsensitive(pathname_, dot_extension)) {    return FilePath(pathname_.substr(        0, pathname_.length() - dot_extension.length()));  }  return *this;}
开发者ID:wllxyz,项目名称:study,代码行数:12,


示例8: _starting_location_t1

EdManipGUIObject::EdManipGUIObject (void)    :   _starting_location_t1   (0.0F),        _starting_location_t2   (0.0F){    _line_material.setBlendEnable(false);    _line_material.setDepthEnable(true);    _line_material.setCullMode(DT3GL_CULL_NONE);    _line_material.setColor(Color(1.0F,1.0F,1.0F,1.0F));	_line_material.setShader(ShaderResource::getShader(FilePath("{editorline.shdr}")));        _red_material.setBlendEnable(false);    _red_material.setDepthEnable(true);    _red_material.setCullMode(DT3GL_CULL_NONE);    _red_material.setColor(Color(1.0F,0.0F,0.0F,1.0F));	_red_material.setShader(ShaderResource::getShader(FilePath("{editorline.shdr}")));    }
开发者ID:9heart,项目名称:DT3,代码行数:17,


示例9: FilePath

	void FileDialog::updateButtons() {		FilePath file_path = m_dir_path / FilePath(toUTF8Checked(m_edit_box->text()));		if(m_mode == FileDialogMode::opening_file)			m_ok_button->enable(file_path.isRegularFile());		else if(m_mode == FileDialogMode::saving_file)			m_ok_button->enable(!file_path.isDirectory());	}
开发者ID:nadult,项目名称:FreeFT,代码行数:8,


示例10: getSelectedFilePaths

 /**     Returns a vector with all selected file paths.     @return a vector with all selected file paths.  */ std::vector<FilePath> getSelectedFilePaths() const {     std::vector<FilePath> result;     int count = getSelectedFileCount();     for(int index = 0; index < count; ++index) {         result.push_back(FilePath(getSelectedFile(index)));     }     return result; }
开发者ID:ucfengzhun,项目名称:ALX,代码行数:12,


示例11: ValidSeparator

filesystem::FilePath	filesystem::FilePath::toValidPath(const std::string& path){	std::string tmp_path = path;	std::replace_if(tmp_path.begin(), tmp_path.end(), ValidSeparator(INVALID_PATH_SEPARATOR), PATH_SEPARATOR);	if (tmp_path.back() == PATH_SEPARATOR)		tmp_path.erase(tmp_path.end());	return FilePath(tmp_path);}
开发者ID:BGCX261,项目名称:zia-tools-svn-to-git,代码行数:8,


示例12: FilePath

	FilePath FilePath::GetFolder()const	{		WString delimiter = Delimiter;		fint pos = _fullPath.FindLast(L'//');		if (!pos)			return FilePath();		return _fullPath.Left(pos);	}
开发者ID:mazip1990,项目名称:FaceUI,代码行数:8,


示例13: FilePath

FilePath FilePath::folderPath() const	{	if (pathParts_.empty())		return FilePath("..");	if (pathParts_.size() == 1)		return FilePath("");	if (pathParts_.back() == upString)		{		std::vector<String> partsWithOnlyUps(pathParts_.size() + 1);		std::fill_n(partsWithOnlyUps.begin(), pathParts_.size() + 1, upString);		return FilePath(partsWithOnlyUps);		}	std::vector<String> partsExceptLast(pathParts_.size() - 1);	partsExceptLast.reserve(pathParts_.size() - 1);	std::copy(pathParts_.begin(), std::prev(pathParts_.end()), partsExceptLast.begin());	return FilePath(partsExceptLast);	}
开发者ID:GromCaptain,项目名称:snake-game-prototype,代码行数:17,


示例14: Register

	bool TextureAsset::Register(const AssetName& name, const Emoji& emoji, const TextureDesc desc, const AssetParameter& parameter)	{		return Register(name, TextureAssetData(FilePath(), desc, parameter,			[=](TextureAssetData& a) { a.texture = Texture(emoji, a.desc); return !!a.texture; },			TextureAssetData::DefaultUpdate,			TextureAssetData::DefaultRelease		));	}
开发者ID:Siv3D,项目名称:OpenSiv3D,代码行数:8,


示例15: getDocument

FilePath XmlDomElement::getDocFilePath() const noexcept{    XmlDomDocument* doc = getDocument(true);    if (doc)        return doc->getFilePath();    else        return FilePath();}
开发者ID:0xB767B,项目名称:LibrePCB,代码行数:8,


示例16: setModelData

void PathDelegate::setModelData(QWidget *editor, QAbstractItemModel *model,	const QModelIndex &index) const{	FilePicker *picker = static_cast<FilePicker*>(editor);	model->setData(index,		QVariant::fromValue(FilePath(picker->value())),		Qt::EditRole);}
开发者ID:pawloKoder,项目名称:Vision3D,代码行数:8,


示例17: FileInfo

	SourceIndex::FileInfo FileInfo::getFileInfo(ConstStrW fname)	{		IFileIOServices &svc = IFileIOServices::getIOServices();		PFolderIterator iter = svc.getFileInfo(fname);		return FileInfo(FilePath(iter->getFullPath(), false), iter->getModifiedTime());	}
开发者ID:ondra-novak,项目名称:sourceIndex,代码行数:8,


示例18: TEST

TEST( FilesystemSnapshot, managingEntries ){   Filesystem& fs = TSingleton< Filesystem >::getInstance();   FilesystemSnapshot snapshot( fs );   snapshot.add( FilePath( "/root/assets/b.txt" ), 0, 0 );   snapshot.add( FilePath( "/root/code/c.lua" ), 0, 0 );   snapshot.add( FilePath( "/root/assets/a.txt" ), 0, 0 );      std::string snapshotStr = "(0)root;(1)code;(2)c.lua;(1)assets;(2)b.txt;(2)a.txt;";   CPPUNIT_ASSERT_EQUAL( snapshotStr, snapshot.toString() );   // removing a non-existing entry from a non-existing directory   snapshot.remove( FilePath( "/root/gameplay/x.txt" ) );   CPPUNIT_ASSERT_EQUAL( snapshotStr, snapshot.toString() );   // removing a non-existing entry from an existing directory   snapshot.remove( FilePath( "/root/code/x.txt" ) );   CPPUNIT_ASSERT_EQUAL( snapshotStr, snapshot.toString() );   // removing an existing entry   snapshot.remove( FilePath( "/root/assets/a.txt" ) );   snapshotStr = "(0)root;(1)code;(2)c.lua;(1)assets;(2)b.txt;";   CPPUNIT_ASSERT_EQUAL( snapshotStr, snapshot.toString() );   // removing an existing entry   snapshot.remove( FilePath( "/root/assets" ) );   snapshotStr = "(0)root;(1)code;(2)c.lua;";   CPPUNIT_ASSERT_EQUAL( snapshotStr, snapshot.toString() );}
开发者ID:dabroz,项目名称:Tamy,代码行数:29,


示例19: addEndSlash

//! flatten a path and file name for example: "/you/me/../." becomes "/you"FilePath FilePath::flattenFilename( const FilePath& root ) const{  std::string directory = addEndSlash().toString();  directory = StringHelper::replace( directory, "//", "/" );    FilePath dir;  FilePath subdir;  int lastpos = 0;  std::string::size_type pos = 0;  bool lastWasRealDir=false;  while( ( pos = directory.find( '/', lastpos) ) != std::string::npos )  {    subdir = FilePath( directory.substr(lastpos, pos - lastpos + 1) );    if( subdir.toString() == "../" )    {      if (lastWasRealDir)      {        dir = dir.getUpDir();        dir = dir.getUpDir();        lastWasRealDir=( dir.toString().size()!=0);      }      else      {        dir = FilePath( dir.toString() + subdir.toString() );        lastWasRealDir=false;      }    }    else if( subdir.toString() == "/")    {      dir = root;    }    else if( subdir.toString() != "./" )    {      dir = FilePath( dir.toString() + subdir.toString() );      lastWasRealDir=true;    }    lastpos = pos + 1;  }  return dir;}
开发者ID:nickers,项目名称:opencaesar3,代码行数:46,


示例20: BrickModel

Renderer::Renderer(BrickModel * parent) :    BrickModel(parent){	itemData.append("Test");	itemData.append("LOl");	path = new FilePathNode(this, FilePath(""), "Data path");	print = new Node<bool>(this, true, "Enable/Disable painting");}
开发者ID:pawloKoder,项目名称:Vision3D,代码行数:9,


示例21: DVASSERT

String FilePath::GetLastDirectoryName() const{    DVASSERT(!IsEmpty() && IsDirectoryPathname());        String path = absolutePathname;    path = path.substr(0, path.length() - 1);        return FilePath(path).GetFilename();}
开发者ID:droidenko,项目名称:dava.framework,代码行数:9,


示例22: FileLocation

FileLocation SourceLocation::getSpellingLocation() const{   std::string file;   unsigned line, column;   if (getSpellingLocation(&file, &line, &column))      return FileLocation(FilePath(file), line, column);   else      return FileLocation();}
开发者ID:AlanCal,项目名称:rstudio,代码行数:9,


示例23: rBinaryPath

FilePath rBinaryPath(){   FilePath binPath = FilePath(R_HomeDir()).complete("bin");#ifdef _WIN32   return binPath.complete("Rterm.exe");#else   return binPath.complete("R");#endif}
开发者ID:AndreMikulec,项目名称:rstudio,代码行数:9,


示例24: ParticleEmitterObject

void GameObjectTestScreen::LoadResources(){	manager = GameObjectManager::Create();	bigBox = GameObject::Create(FilePath("~res:/Gfx/GameObjects/blueboxbig"));	bigBox->SetPivotPoint(ALIGN_HCENTER | ALIGN_VCENTER);	bigBox->SetPosition(200, 200);	manager->AddObject(bigBox.Get());	smallBox = GameObject::Create(FilePath("~res:/Gfx/GameObjects/bluebox"));	smallBox->SetPivotPoint(ALIGN_HCENTER | ALIGN_VCENTER);	bigBox->AddObject(smallBox.Get());	smallCircle = GameObject::Create(FilePath("~res:/Gfx/GameObjects/bluecircle"));	smallCircle->SetPosition(bigBox->GetSize());	smallCircle->SetPivotPoint(ALIGN_HCENTER | ALIGN_VCENTER);	bigBox->AddObject(smallCircle.Get());		bigBox->SetAngle(DegToRad(30.0f));	time = 0.0f;		bigBoxParticles = GameObject::Create(FilePath("~res:/Gfx/GameObjects/blueboxbig"));	bigBoxParticles->SetPivotPoint(ALIGN_HCENTER | ALIGN_VCENTER);	bigBoxParticles->SetPosition(200, 100);	manager->AddObject(bigBoxParticles.Get());		bigBoxEmitter = new ParticleEmitterObject(); 	bigBoxEmitter->LoadFromYaml(FilePath("~res:/Particles/Sparkles/sparkles_clockmaster_clear.yaml"));	bigBoxEmitter->SetPriority(10);	//	RefPtr<GameObject> centerTest  = GameObject::Create("~res:/Gfx/GameObjects/bluecircle");//	centerTest->SetPosition(0, 0);//	centerTest->SetPivotPoint(ALIGN_HCENTER | ALIGN_VCENTER);//	bigBoxEmitter->AddObject(centerTest.Get());	smallCircle->AddObject(bigBoxEmitter.Get());#if 0	ParticleEmitterObject* bigBoxEmitterClone = new ParticleEmitterObject();	bigBoxEmitterClone->SetEmitter(bigBoxEmitter->GetEmitter()->Clone());	bigBoxEmitterClone->SetPriority(10);	bigBoxEmitterClone->SetPosition(Vector2(300, 300));	manager->AddObject(bigBoxEmitterClone);#endif}
开发者ID:boyjimeking,项目名称:dava.framework,代码行数:44,


示例25: GetAppDataPath

plx::FilePath GetAppDataPath(bool roaming) {  auto folder = roaming? FOLDERID_RoamingAppData : FOLDERID_LocalAppData;  wchar_t* path = nullptr;  auto hr = ::SHGetKnownFolderPath(folder, 0, nullptr, &path);  if (hr != S_OK)    throw plx::IOException(__LINE__, L"<appdata folder>");  auto fp = FilePath(path);  ::CoTaskMemFree(path);  return fp;}
开发者ID:cpizano,项目名称:CamCenter,代码行数:10,


示例26: GetFilename

 bool OSExchangeDataProviderWin::GetFilename(FilePath* path) const {     std::vector<string16> filenames;     bool success = ClipboardUtil::GetFilenames(source_object_, &filenames);     if(success)     {         *path = FilePath(filenames[0]);     }     return success; }
开发者ID:abyvaltsev,项目名称:putty-nd3.x,代码行数:10,


示例27: FindLastPathSeparator

// RemoveFileName returns the directory path with the filename removed.// Example: FilePath("path/to/file").RemoveFileName() returns "path/to/".// If the FilePath is "a_file" or "/a_file", RemoveFileName returns// FilePath("./") or, on Windows, FilePath(".//"). If the filepath does// not have a file, like "just/a/dir/", it returns the FilePath unmodified.// On Windows platform, '/' is the path separator, otherwise it is '/'.FilePath FilePath::RemoveFileName() const {  const char* const last_sep = FindLastPathSeparator();  std::string dir;  if (last_sep) {    dir = std::string(c_str(), last_sep + 1 - c_str());  } else {    dir = kCurrentDirectoryString;  }  return FilePath(dir);}
开发者ID:wllxyz,项目名称:study,代码行数:16,


示例28: Init

/*     * Initializes the object, assuming that filename, origin, size, etc are already set on the     * member variables. Makes sure the raster can be opened, sets the block size, NODATA value,     * pixel size, and the extent of the raster. If not using the full image then makes sure that     * the subset chosen (based on origin and size) is valid. If using the full image then sets the     * size and origin is assumed to be 0,0 and is set in the constructor.     * @param fullImage True if using the full image, False if using a subset.     */void Raster::Init(bool bFullImage){    Init();    GDALDataset * ds = (GDALDataset*) GDALOpen(m_sFilePath, GA_ReadOnly);    if (ds == NULL)        throw RasterManagerException(INPUT_FILE_NOT_VALID, CPLGetLastErrorMsg());    GDALRasterBand * band = ds->GetRasterBand(1);    double dRMin, dRMax, dRMean, dRStdDev;    // Get some easy stats that GDAL gives us    band->GetStatistics( 0 , true, &dRMin, &dRMax, &dRMean, &dRStdDev );    m_dRasterMax = dRMax;    m_dRasterMin = dRMin;    m_dRasterMean = dRMean;    m_dRasterStdDev = dRStdDev;    OGRLinearRing ring = OGRLinearRing();    if (bFullImage)    {        SetCols( band->GetXSize() );        SetRows( band->GetYSize() );        ring.addPoint(GetLeft(), GetTop());        ring.addPoint(GetLeft(), GetTop() + (GetCellHeight() * GetRows()));        ring.addPoint(GetLeft() + (GetCellWidth() * GetCols()), GetTop() + (GetCellHeight() * GetRows()));        ring.addPoint(GetLeft() + (GetCellWidth() * GetCols()), GetTop());        ring.closeRings();    }    else    {        if ((GetLeft() + GetCols() > band->GetXSize()) || (GetTop() + GetRows() > band->GetYSize()))        {            QString sErr = QString("Invalid origin ( %1, %2 ) and size ( %5, %6 ) for file: %7")                    .arg(GetLeft())                    .arg(GetTop())                    .arg(GetCols())                    .arg(GetRows())                    .arg(FilePath());            throw RasterManagerException(INPUT_FILE_NOT_VALID, sErr);        }        double xMapOrigin = GetLeft() + (GetLeft() * GetCellWidth());        double yMapOrigin = GetTop() + (GetTop() * GetCellHeight());        ring.addPoint(xMapOrigin, yMapOrigin);        ring.addPoint(xMapOrigin, yMapOrigin + (GetCellHeight() * GetRows()));        ring.addPoint(xMapOrigin + (GetCellWidth() * GetCols()), yMapOrigin + (GetCellHeight() * GetRows()));        ring.addPoint(xMapOrigin + (GetCellWidth() * GetCols()), yMapOrigin);        ring.closeRings();    }    GDALClose(ds);}
开发者ID:JamesSLC,项目名称:rasterman,代码行数:63,



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


C++ FileRead函数代码示例
C++ FileOpen函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。