MySQL++ SSQLS v2 Translator: ParseV2::File Class Reference

MySQL++ SSQLS v2 Translator 3.3.0

Public Member Functions | List of all members
ParseV2::File Class Reference

Holds information about an SSQLS v2 file we're parsing. More...

`#include <parsev2.h>`

## Public Member Functions
| File (const char *file_name)
| Open a file for reading, using the search path to file the file if the direct path isn't readable.
void | error (const std::string &msg) const
| Throw a FileException containing the given message.
void | error (const std::ostringstream &msg) const
const char * | name () const
| Return the file's name.
void | parse_error (const std::string &msg) const
| Throw a ParseException containing the given message and our stored info about the file name and current line.
void | parse_error (const std::ostringstream &msg) const
bool | read_line (std::string &line, bool &subdirective)
| Read a line in from a file. More...

## Detailed Description

Holds information about an SSQLS v2 file we're parsing.

This class exists simply because there's so much file-related processing in the parser, and it's confusing to have it scattered about.

## Member Function Documentation

## ◆ error()

void ParseV2::File::error | ( | const std::ostringstream & | msg | ) | const
| inline

See also
  error(const std::string&)

References error().

## ◆ parse_error()

void ParseV2::File::parse_error | ( | const std::ostringstream & | msg | ) | const
| inline

See also
  parse_error(const std::string&)

References error().

## ◆ read_line()

bool ParseV2::File::read_line | ( | std::string & | line,
|  | bool & | subdirective
| ) |  |

Read a line in from a file.

We read the line from our internal file object, trimming any trailing comment. Does not trim whitespace; we depend on ParseV2::tokenize() to cope with that. Sets subdirective flag if we see leading whitespace before we trim it away, as indented lines are interpreted differently by File's users.

Returns
  false if our internal file object is in an error condition on entering or exiting this function.

Referenced by ParseV2::ParseV2().

The documentation for this class was generated from the following files:

- parsev2.h
- parsev2.cpp