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


C++ PathList类代码示例

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


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

示例1: GetCreateFileEditPosHistory

bool GetCreateFileEditPosHistory( clPtr<FS>* Fs, FSPath* Path, sEditorScrollCtx& Ctx )
{
	if ( !g_WcmConfig.editSavePos || !Fs || !Fs->Ptr() || !Path )
	{
		return false;
	}
	
	std::vector<unicode_t> Name = new_unicode_str( (*Fs)->Uri( *Path ).GetUnicode() );
	
	// check if item already exists in the list
	const int Index = g_ViewList.FindByName( Name.data() );
	if ( Index != -1 )
	{
		StrConfig* Cfg = g_ViewList.GetData( Index )->conf.ptr();
		Ctx.m_FirstLine = Cfg->GetIntVal( EDIT_FIRST_LINE );
		Ctx.m_Point.line = Cfg->GetIntVal( EDIT_POINT_LINE );
		Ctx.m_Point.pos = Cfg->GetIntVal( EDIT_POINT_POS );
		return true;
	}
	
	// collect all needed path information
	PathList::Data Data;
	if ( PathListFSToData( Data, Fs, Path ) )
	{
		AddFileEditToHistory( Index, Data, 0, 0, 0 );
	}
	
	return false;
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:29,代码来源:view-history.cpp

示例2: GetCreateFileViewPosHistory

int GetCreateFileViewPosHistory( clPtr<FS>* Fs, FSPath* Path )
{
	if ( !g_WcmConfig.editSavePos || !Fs || !Fs->Ptr() || !Path )
	{
		return -1;
	}
	
	std::vector<unicode_t> Name = new_unicode_str( (*Fs)->Uri( *Path ).GetUnicode() );
	
	// check if item already exists in the list
	const int Index = g_ViewList.FindByName( Name.data() );
	if ( Index != -1 )
	{
		StrConfig* Cfg = g_ViewList.GetData( Index )->conf.ptr();
		return Cfg->GetIntVal( VIEW_POS );
	}
	
	// collect all needed path information
	PathList::Data Data;
	if ( PathListFSToData( Data, Fs, Path ) )
	{
		AddFileViewToHistory( -1, Data, 0 );
	}
	
	return 0;
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:26,代码来源:view-history.cpp

示例3: printPathList

void Conn::printPathList(PathList& paths, Fleet::Ptr _fleet)
{
  
  
 // cout << "\n\nPrinting path list \n\n";
  while(!paths.empty())
	{

    Cost cost(0);
  	Time time(0);
    bool exp = true;
    Path p = paths.front();
		Path::iterator it = p.begin();

    for(; it != p.end(); it++)
		{
		  Segment* seg = *it;
			cost = cost + seg->cost(_fleet);
      time = time + seg->time(_fleet);
			if(!seg->expediteSupport()) exp = false;
		}
    cout << cost.string() << " " << time.string() << " " << (exp?"yes; ":"no; ");
	  Conn::printPath(paths.front());
		cout << "\n";
	  paths.pop();
	}
	
}
开发者ID:bhupc,项目名称:shipping-assignment,代码行数:28,代码来源:Conn.cpp

示例4: getChildren

bool Path::getChildren(PathList& children) const
{
#if WENDY_SYSTEM_WIN32
  WIN32_FIND_DATA data;
  HANDLE search;

  search = FindFirstFile(path.c_str(), &data);
  if (search == INVALID_HANDLE_VALUE)
    return false;

  do
  {
    children.push_back(operator + (data.cFileName));
  }
  while (FindNextFile(search, &data));

  FindClose(search);
#else
  DIR* stream;
  dirent* entry;

  stream = opendir(path.c_str());
  if (!stream)
    return false;

  while ((entry = readdir(stream)))
    children.push_back(operator + (entry->d_name));

  closedir(stream);
#endif
  return true;
}
开发者ID:r-lyeh-forks,项目名称:Wendy,代码行数:32,代码来源:Path.cpp

示例5: AddFolderToHistory

void AddFolderToHistory( clPtr<FS>* fs, FSPath* path )
{
	if ( fs && fs->Ptr() && path )
	{
		// collect all needed path information
		PathList::Data data;

		if ( PathListFSToData( data, fs, path ) )
		{
			// check if item already exists in the list
			const int index = g_dataList.FindByName( data.name.data() );

			if ( index != -1 )
			{
				// remove existing item
				g_dataList.Remove( index );
			}

			// add item to the and of the list
			g_dataList.Add( data.name.data(), data.conf );

			// limit number of elements in the list
			while ( g_dataList.GetCount() > MAX_FOLDERS_HISTORY_COUNT )
			{
				g_dataList.Remove( 0 );
			}
		}
	}
}
开发者ID:0-wiz-0,项目名称:WCMCommander,代码行数:29,代码来源:folder-history.cpp

示例6: FindFirstFile

PathList Path::children() const
{
  PathList children;

#if WENDY_SYSTEM_WIN32
  WIN32_FIND_DATA data;
  HANDLE search;

  search = FindFirstFile(m_string.c_str(), &data);
  if (search == INVALID_HANDLE_VALUE)
    return PathList();

  do
  {
    children.push_back(operator + (data.cFileName));
  }
  while (FindNextFile(search, &data));

  FindClose(search);
#else
  DIR* stream;
  dirent* entry;

  stream = opendir(m_string.c_str());
  if (!stream)
    return PathList();

  while ((entry = readdir(stream)))
    children.push_back(operator + (entry->d_name));

  closedir(stream);
#endif

  return children;
}
开发者ID:tapio,项目名称:Wendy,代码行数:35,代码来源:Path.cpp

示例7: listDir

 size_t Path::listDir(PathList &l, bool recurse, unsigned short flags) const {
   EachFunc func;
   details::DirLister dl(l);
   Bind(&dl, &details::DirLister::dirItem, func);
   l.clear();
   each(func, recurse, flags);
   return l.size();
 }
开发者ID:gatgui,项目名称:gcore,代码行数:8,代码来源:path.cpp

示例8: removeGridPath

void DataManager::removeGridPath(int x, int y, PathVect* path) {
	PathList* objects = &GET_GRID_ITEM(grid,x,y).paths;
	for (PathList::iterator it = objects->begin(); it != objects->end(); it++) {
		if ((*it).second == path) {
			objects->erase(it);
			break;
		}
	}
}
开发者ID:cheesecakenl,项目名称:git-c-plusplus,代码行数:9,代码来源:DataManager.cpp

示例9:

/* static private */
void
SharedPathsOp::clearEdges(PathList& edges)
{
  for (PathList::const_iterator
        i=edges.begin(), e=edges.end();
        i!=e; ++i)
  {
    delete *i;
  }
  edges.clear();
}
开发者ID:AvlWx2014,项目名称:basemap,代码行数:12,代码来源:SharedPathsOp.cpp

示例10: xpath

Container::PathList Container::PackageLocations() const
{
    XPathWrangler xpath(_ocf, {{"ocf", "urn:oasis:names:tc:opendocument:xmlns:container"}});

    PathList output;
    for ( string& str : xpath.Strings(gRootfilePathsXPath) )
    {
        output.emplace_back(std::move(str));
    }

    return output;
}
开发者ID:jalal70,项目名称:readium-sdk,代码行数:12,代码来源:container.cpp

示例11: findLinearIntersections

/* public */
void
SharedPathsOp::getSharedPaths(PathList& forwDir, PathList& backDir)
{
  PathList paths;
  findLinearIntersections(paths);
  for (size_t i=0, n=paths.size(); i<n; ++i)
  {
    LineString* path = paths[i];
    if ( isSameDirection(*path) ) forwDir.push_back(path);
    else backDir.push_back(path);
  }
}
开发者ID:AvlWx2014,项目名称:basemap,代码行数:13,代码来源:SharedPathsOp.cpp

示例12: find_sys_include

 string find_sys_include(string includeName)
 {
     for(PathList::const_iterator i = includePaths.begin(); i != includePaths.end(); i++)
     {
         string path = *i + includeName;
         std::ifstream test(path.c_str(), std::ifstream::in);
         bool found = test.is_open();
         test.close();
         if(found) return *i;
     }
     return includeName;
 }
开发者ID:Nobody-7,项目名称:tcpppl_answers,代码行数:12,代码来源:ex04.cpp

示例13: SearchPathList

  PathName PathName::SearchPathList(const PathList &pathList) const {
    PathName fullFileName;
    
    for (PathList::const_iterator i = pathList.begin(); i != pathList.end(); ++i) {
      
      fullFileName = *i;
      fullFileName.Append(*this);
      if (fullFileName.IsFile())
	return fullFileName;
    }
    return fullFileName;
  }
开发者ID:blowekamp,项目名称:CXMLTestFramework,代码行数:12,代码来源:PathName.cpp

示例14: add_to_vector

// helps fill in the path matrix (see below)
void add_to_vector (PathList& previous_vector, wstring* to_add) {
  wstring string_rep = represent_path (to_add, 2);
  if (previous_vector.size() == 0) {
    previous_vector.push_back (string_rep);
  }
  else {
    PathList::iterator it;
    // if there is more than one possible path, add to all of them
    for (it=previous_vector.begin(); it != previous_vector.end(); it++) {
      it->append (string_rep);
    }
  }
}
开发者ID:anneCarlson,项目名称:Igbo,代码行数:14,代码来源:comparelists8.cpp

示例15: path

void Path::fillBinaryPackagesList(std::vector<std::string>& pkglist)
{
    std::string header = "Packages from: ";
    header += path().getBinaryPackagesDir();
    pkglist.clear();
    pkglist.push_back(header);
    PathList pkgs = path().getBinaryPackages();
    std::sort(pkgs.begin(), pkgs.end());
    PathList::const_iterator itb = pkgs.begin();
    PathList::const_iterator ite = pkgs.end();
    for (; itb!=ite; itb++){
        pkglist.push_back(*itb);
    }
    return;
}
开发者ID:GG31,项目名称:vle,代码行数:15,代码来源:Path.cpp


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