# BasicFileLocation Class Reference

This class is mainly used by BasicException, but can be used as a general class for recording a line and column location with in a file. More...

`#include <BasicFileLocation.h>`

List of all members.

## Public Member Functions

| BasicFileLocation ()
| Construct a default BasicFileLocation with an empty value.
| BasicFileLocation (const BasicFileLocation &x)
| Copy constructor.
| BasicFileLocation (const std::string filename, const long line, const long col)
virtual | ~BasicFileLocation ()
const std::string | getFilename () const
const long | getLine () const
const long | getCol () const
bool | isEmpty () const

## Private Attributes

std::string | filename
long | line
long | col
bool | empty

## Friends

std::ostream & | operator<< (std::ostream &stream, const BasicFileLocation &fl)
| Print a file location to a stream.

## Detailed Description

This class is mainly used by BasicException, but can be used as a general class for recording a line and column location with in a file.

## Constructor & Destructor Documentation

BasicFileLocation::BasicFileLocation | ( |  | ) | `[inline]`

| Construct a default BasicFileLocation with an empty value.

BasicFileLocation::BasicFileLocation | ( | const BasicFileLocation & | x | ) | `[inline]`

| Copy constructor.

BasicFileLocation::BasicFileLocation | ( | const std::string | filename,
|  | const long | line,
|  | const long | col
| ) | `[inline]`

Parameters:

  | filename | The name of the file.
  | line | The line with that file.
  | col | The column on that line.

virtual BasicFileLocation::~BasicFileLocation | ( |  | ) | `[inline, virtual]`

## Member Function Documentation

const long BasicFileLocation::getCol | ( |  | ) | const`[inline]`

Returns:
  -1 of no column was set the column number otherwise.

const std::string BasicFileLocation::getFilename | ( |  | ) | const`[inline]`

const long BasicFileLocation::getLine | ( |  | ) | const`[inline]`

Returns:
  -1 if no line was set the line number otherwise.

bool BasicFileLocation::isEmpty | ( |  | ) | const`[inline]`

Returns:
  True of no filename, line, or column have been set.

## Friends And Related Function Documentation

std::ostream& operator<< | ( | std::ostream & | stream,
|  | const BasicFileLocation & | fl
| ) | `[friend]`

Print a file location to a stream.

The format is as follows.

filename[:line[:col]]

If no line or column has been set then they will not be displayed.

Returns:
  A reference to the passed stream.

## Member Data Documentation

long BasicFileLocation::col `[private]`

bool BasicFileLocation::empty `[private]`

std::string BasicFileLocation::filename `[private]`

long BasicFileLocation::line `[private]`

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

- BasicFileLocation.h