/Users/brown170/Projects/Current/coral_msu_repo/trunk/src/coralutils/convert.h File Reference

#include <string>
#include <iostream>
#include <vector>

Include dependency graph for convert.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

string remove_leading_blanks (const string &instring)
 A function that removes the leading blanks of a string.
string remove_trailing_blanks (const string &instring)
 A function that removes the trailing blanks of a string.
string remove_extra_blanks (const string &instring)
 A function that removes extra blanks in a string.
string remove_all_blanks (const string &instring)
 A function that removes all blanks in a string.
string remove (const string &instring, const string &target)
 A function that removes all instances of a string.
string replace (const string &instring, const string &old_pattern, const string &new_pattern)
 A function that replaces all instances of one string with another.
string slice (const string &instring, int istart, int ifinish)
 A function to slice a string.
string remove_comments (const string &instring, const string &comment_string)
 A function to remove everything past a comment.
vector< string > split (const string &s, const string pattern=" ")
string join (const vector< string > &ls, const string &pattern=",")
 joins a list of strings using "pattern" as glue
string tolower (const string &s)
 A function that lower-cases strings.
string operator* (int i, const string &x)
 i copies of a string x pasted together
string center (const string &stuff, int len)
 center a string in a field of a certain length
string ljust (const string &stuff, int len)
 left justify a string in a field of a certain length
string rjust (const string &stuff, int len)
 right justify a string in a field of a certain length


Function Documentation

string center ( const string &  stuff,
int  len 
)

center a string in a field of a certain length

Definition at line 100 of file convert.cc.

string join ( const vector< string > &  ls,
const string &  pattern = "," 
)

joins a list of strings using "pattern" as glue

Definition at line 70 of file convert.cc.

string ljust ( const string &  stuff,
int  len 
)

left justify a string in a field of a certain length

Definition at line 109 of file convert.cc.

string operator* ( int  i,
const string &  x 
)

i copies of a string x pasted together

Definition at line 93 of file convert.cc.

string remove ( const string &  instring,
const string &  target 
)

A function that removes all instances of a string.

Definition at line 124 of file convert.cc.

string remove_all_blanks ( const string &  instring  ) 

A function that removes all blanks in a string.

Definition at line 32 of file convert.cc.

string remove_comments ( const string &  instring,
const string &  comment_string 
)

A function to remove everything past a comment.

Definition at line 43 of file convert.cc.

string remove_extra_blanks ( const string &  instring  ) 

A function that removes extra blanks in a string.

Definition at line 21 of file convert.cc.

string remove_leading_blanks ( const string &  instring  ) 

A function that removes the leading blanks of a string.

Definition at line 5 of file convert.cc.

string remove_trailing_blanks ( const string &  instring  ) 

A function that removes the trailing blanks of a string.

Definition at line 13 of file convert.cc.

string replace ( const string &  instring,
const string &  old_pattern,
const string &  new_pattern 
)

A function that replaces all instances of one string with another.

Definition at line 129 of file convert.cc.

string rjust ( const string &  stuff,
int  len 
)

right justify a string in a field of a certain length

Definition at line 116 of file convert.cc.

string slice ( const string &  instring,
int  istart,
int  ifinish 
)

A function to slice a string.

Definition at line 134 of file convert.cc.

vector< string > split ( const string &  s,
const string  pattern 
)

splits a string at all occurances of "pattern" and returns the substrings in a list

Definition at line 51 of file convert.cc.

string tolower ( const string &  s  ) 

A function that lower-cases strings.

Definition at line 84 of file convert.cc.


Generated on Fri Feb 6 13:30:16 2009 for CorAL by  doxygen 1.5.8