Back to index

nordugrid-arc-nox  1.1.0~rc6
Functions
gridmap.h File Reference
#include <string>
#include <list>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool gridmap_user_list (std::string &ulist)
bool gridmap_user_list (std::list< std::string > &ulist)

Function Documentation

bool gridmap_user_list ( std::string &  ulist)

Definition at line 30 of file gridmap.cpp.

                                         {
  std::string path = globus_gridmap();
  std::ifstream f(path.c_str()); 
  if(! f.is_open() ) return false;
  for(;!f.eof();) {
    char buf[512];
    istream_readline(f,buf,sizeof(buf));
    std::string rest = buf;
    std::string name = "";
    for(;rest.length() != 0;) {
      name=config_next_arg(rest);
    };
    if(name.length() == 0) continue;
    std::string::size_type pos;
    if((pos=ulist.find(name)) != std::string::npos) {
      if(pos!=0) 
        if(ulist[pos-1] != ' ') { ulist+=" "+name; continue; };
      pos+=name.length();
      if(pos < ulist.length())
        if(ulist[pos] != ' ') { ulist+=" "+name; continue; };
    }
    else { ulist+=" "+name; };
  };
  f.close();
  return true;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool gridmap_user_list ( std::list< std::string > &  ulist)

Definition at line 57 of file gridmap.cpp.

                                                  {
  std::string path = globus_gridmap();
  std::ifstream f(path.c_str()); 
  if(! f.is_open() ) return false;
  for(;!f.eof();) {
    char buf[512];
    istream_readline(f,buf,sizeof(buf));
    std::string rest = buf;
    std::string name = "";
    for(;rest.length() != 0;) {
      name=config_next_arg(rest);
    };
    if(name.length() == 0) continue;
    std::string::size_type pos;
    for(std::list<std::string>::iterator u = ulist.begin();
                          u != ulist.end(); ++u) {
      if(name == *u) { name.resize(0); break; };
    };
    if(name.length() == 0) continue;
    ulist.push_back(name);
  };
  f.close();
  return true;
}

Here is the call graph for this function: