CMS 3D CMS Logo

IgNameList.h File Reference

#include "Iguana/Framework/interface/config.h"
#include <string>
#include <list>

Go to the source code of this file.

Typedefs

typedef IgNameList::const_iterator IgNameIterator
 An iterator over IgNameList.
typedef std::list< std::string > IgNameList
 A list of names.

Functions

bool isNameList (const std::string &list)
 Check if the string is a name list: that it has at least two words separated by spaces.
std::string makeNameList (const IgNameList &from)
 Make a name list string from the list from.
void splitNameList (IgNameList &to, const std::string &from)
 Split names in name list from to the list to.


Typedef Documentation

typedef IgNameList::const_iterator IgNameIterator

An iterator over IgNameList.

Definition at line 21 of file IgNameList.h.

typedef std::list<std::string> IgNameList

A list of names.

Definition at line 18 of file IgNameList.h.


Function Documentation

bool isNameList ( const std::string &  list  )  [inline]

Check if the string is a name list: that it has at least two words separated by spaces.

Definition at line 28 of file IgNameList.h.

00029 { return list.find_first_not_of (' ') != std::string::npos; }

std::string makeNameList ( const IgNameList from  )  [inline]

Make a name list string from the list from.

Definition at line 47 of file IgNameList.h.

References name, and HLT_VtxMuL3::result.

00048 {
00049     IgNameIterator      name = from.begin ();
00050     std::string         result;
00051 
00052     while (true)
00053     {
00054         result.append (*name);
00055         if (++name == from.end ())
00056             break;
00057         result.append (1, ' ');
00058     }
00059     return result;
00060 }

void splitNameList ( IgNameList to,
const std::string &  from 
) [inline]

Split names in name list from to the list to.

Definition at line 33 of file IgNameList.h.

References end.

00034 {
00035     std::string::size_type start = 0;
00036     std::string::size_type end;
00037     do {
00038         end = from.find_first_of (' ', start);
00039         to.push_back (from.substr (start, end));
00040         start = (end == std::string::npos ? end
00041                  : from.find_first_not_of (' ', end));
00042     } while (start != std::string::npos);
00043 }


Generated on Tue Jun 9 17:54:04 2009 for CMSSW by  doxygen 1.5.4