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

C++ FilePath函数代码示例

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

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



在下文中一共展示了FilePath函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:block.cpp


示例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,代码来源:TranslationUnit.cpp


示例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,代码来源:RegularFile.cpp


示例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,代码来源:gtest-filepath.cpp


示例5: FilePath

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


示例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,代码来源:MipmapReplacer.cpp


示例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,代码来源:gtest-filepath.cpp


示例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,代码来源:EdManipGUIObject.cpp


示例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,代码来源:file_dialog.cpp


示例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,代码来源:NativeFileDialog.hpp


示例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,代码来源:FilePath.cpp


示例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,代码来源:FileSystem.cpp


示例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,代码来源:FilePath.cpp


示例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,代码来源:SivTextureAsset.cpp


示例15: getDocument

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


示例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,代码来源:pathdelegate.cpp


示例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,代码来源:fileInfo.cpp


示例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,代码来源:FilesystemSnapshotTests.cpp


示例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,代码来源:oc3_filepath.cpp


示例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,代码来源:renderer.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ FileRead函数代码示例发布时间:2022-05-30
下一篇:
C++ FileOpen函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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