ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/trunk/OOPSE-2.0/src/utils/StringUtils.hpp
Revision: 1598
Committed: Tue Oct 19 18:21:25 2004 UTC (19 years, 9 months ago) by chrisfen
File size: 1321 byte(s)
Log Message:
changed around findBegin

File Contents

# User Rev Content
1 gezelter 1590 /**
2     * @file StringUtils.hpp
3     * @author Dan Gezelter
4     * @date 10/18/2004
5     * @version 1.0
6     */
7    
8     #ifndef UTILS_STRINGUTILS_HPP
9     #define UTILS_STRINGUTILS_HPP
10 gezelter 1490 #include <string>
11 gezelter 1590 #include <iostream>
12     #include <fstream>
13 gezelter 1490
14 gezelter 1590 namespace oopse {
15 gezelter 1490
16 gezelter 1590 using namespace std;
17    
18    
19     /**
20     * Converts a string to UPPER CASE
21     * @param S
22     */
23     string UpperCase(const string& S);
24    
25     /**
26     * Converts a string to lower case
27     * @param S
28     */
29     string LowerCase(const string& S);
30    
31     /**
32 chrisfen 1598 * Removes left and right spaces from a string
33     *
34     * @param str String to trim
35     *
36     * @return char* to the trimed string
37     */
38     char* trimSpaces(char *str);
39    
40     /**
41 gezelter 1590 * Finds the location of the string "begin <startText>" in an input stream.
42     * @param theStream
43     * @param startText
44     *
45     * @return the line number of the block within the theStream
46     */
47 chrisfen 1598 int findBegin(istream &theStream, char* startText );
48 gezelter 1590
49     /**
50     * Counts the number of tokens on line which are delimited by the characters
51     * listed in delimiters
52     * @param line
53     * @param delimiters
54     */
55     int countTokens(char *line, char *delimiters);
56    
57     /**
58     * discovers whether or not the line contains the "end" token
59     *
60     * @param line The line to test
61     *
62     * @return int (==1 if the line has "end", ==0 if not).
63     */
64     int isEndLine(char *line);
65     }
66    
67 gezelter 1490 #endif