Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# APPSPACK_Utils.hpp File Reference

## Detailed Description

No classes - just some utility functions in the APPSPACK namespace.

Definition in file APPSPACK_Utils.hpp.`#include "APPSPACK_Common.hpp"`
`#include "APPSPACK_Parameter_List.hpp"`

Include dependency graph for APPSPACK_Utils.hpp:

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

Go to the source code of this file.

## Namespaces
namespace | APPSPACK
## Functions
bool | getNextQuotedString (const string &line, string::size_type &pos, string &value)
bool | getNextString (const string &line, string::size_type &pos, string &value)
bool | getNextDouble (const string &line, string::size_type &pos, double &value)
bool | getNextInt (const string &line, string::size_type &pos, int &value)
bool | parseTextInputFile (const string filename, Parameter::List &params)
| Parse an APPSPACK input file and store the data in the given parameter list.
bool | processTextInputFileLine (const string &line, Parameter::List &params, Parameter::List *&subPtr)
| Process a single line of the text input file.
Vector | createZeroVector (int n)
| Create a zero Vector of size n.

## Function Documentation

bool APPSPACK::getNextQuotedString | ( | const string & | line,
|  | string::size_type & | pos,
|  | string & | value
| ) |

  | Get the next quoted string on the given line, starting at position pos. Parameters:
  | line | - Line of text from which to read
  | pos | - On input, the starting position in the line. On output, the next position after the quoted string (which may be std::string::npos). If there is any sort of error, this is set to std::string::npos upon return.
  | value | - On output, filled in with the quoted string (without the quotes). This is an empty string if no quoted string is found.
  Return values:
  | Returns | true if the quoted string is successfully found, false otherwise.
Definition at line 44 of file APPSPACK_Utils.cpp. Referenced by APPSPACK::processTextInputFileLine().

bool APPSPACK::getNextString | ( | const string & | line,
|  | string::size_type & | pos,
|  | string & | value
| ) |

  | Get the next string on the given line, starting at position pos. Parameters:
  | line | - Line of text from which to read
  | pos | - On input, the starting position in the line. On output, the next position after the string (which may be std::string::npos). If there is any sort of error, this is set to std::string::npos upon return.
  | value | - On output, filled in with the next string (i.e., the next contguous block of non-space characters). This is an empty string if no string is found.
  Return values:
  | Returns | true if the string is successfully found, false otherwise.
Definition at line 88 of file APPSPACK_Utils.cpp. Referenced by APPSPACK::getNextDouble(), APPSPACK::getNextInt(), APPSPACK::Cache::Manager::processInputLine(), and APPSPACK::processTextInputFileLine().

bool APPSPACK::getNextDouble | ( | const string & | line,
|  | string::size_type & | pos,
|  | double & | value
| ) |

  | Get the next string on the given line, starting at position pos, and convert it to a double. Parameters:
  | line | - Line of text from which to read
  | pos | - On input, the starting position in the line. On output, the next position after the string (which may be std::string::npos). If there is any sort of error in reading the next string, this is set to std::string::npos upon return.
  | value | - On output, filled in with the double value constained in the next string (i.e., the next contguous block of non-space characters).
  Return values:
  | Returns | true if the next string contains a double, false otherwise.
Definition at line 131 of file APPSPACK_Utils.cpp. References APPSPACK::getNextString(). Referenced by APPSPACK::Cache::Manager::processInputLine(), APPSPACK::processTextInputFileLine(), and APPSPACK::Evaluator::SystemCall::readOutputFile().

bool APPSPACK::getNextInt | ( | const string & | line,
|  | string::size_type & | pos,
|  | int & | value
| ) |

  | Get the next string on the given line, starting at position pos, and convert it to a int. Parameters:
  | line | - Line of text from which to read
  | pos | - On input, the starting position in the line. On output, the next position after the string (which may be std::string::npos). If there is any sort of error in reading the next string, this is set to std::string::npos upon return.
  | value | - On output, filled in with the int value constained in the next string (i.e., the next contguous block of non-space characters).
  Return values:
  | Returns | true if the next string contains a int, false otherwise.
Definition at line 122 of file APPSPACK_Utils.cpp. References APPSPACK::getNextString(). Referenced by APPSPACK::processTextInputFileLine().

bool APPSPACK::parseTextInputFile | ( | const string | filename,
|  | Parameter::List & | params
| ) |

  | Parse an APPSPACK input file and store the data in the given parameter list. Parameters:
  | filename | - The file name. See Step 2: Create an APPSPACK input file for details on the structure of the input file.
  | params | - The parameter list that is to be filled in by this function
Returns: Returns false if there are any problems parsing the input file, true otherwise. Definition at line 362 of file APPSPACK_Utils.cpp. References APPSPACK::processTextInputFileLine(). Referenced by main().

bool APPSPACK::processTextInputFileLine | ( | const string & | line,
|  | Parameter::List & | params,
|  | Parameter::List *& | subPtr
| ) |

| Process a single line of the text input file. Definition at line 140 of file APPSPACK_Utils.cpp. References APPSPACK::getNextDouble(), APPSPACK::getNextInt(), APPSPACK::getNextQuotedString(), APPSPACK::getNextString(), APPSPACK::Parameter::List::setParameter(), APPSPACK::Value::setValueTo(), APPSPACK::Parameter::List::sublist(), and APPSPACK::Vector. Referenced by APPSPACK::parseTextInputFile().

APPSPACK::Vector APPSPACK::createZeroVector | ( | int | n | ) |

| Create a zero Vector of size n. Definition at line 397 of file APPSPACK_Utils.cpp. References APPSPACK::Vector. Referenced by APPSPACK::Directions::Directions().

© Sandia Corporation | Site Contact | Privacy and Security

Generated on Wed Dec 14 18:41:05 2005 for APPSPACK 4.0.2 by 1.3.8 written by Dimitri van Heesch, © 1997-2002