sbuild::parse_error Class Reference

Parse error. More...

#include <sbuild-parse-error.h>

Inheritance diagram for sbuild::parse_error:

Inheritance graph
[legend]
Collaboration diagram for sbuild::parse_error:

Collaboration graph
[legend]
List of all members.

Public Types

 NONE
 No error occured. Used for detail only.
 BAD_FILE
 The file to parse couldn't be opened.
 BAD_VALUE
 The value could not be parsed.
 INVALID_LINE
 The line is invalid.
 NO_GROUP
 No group was specified.
 INVALID_GROUP
 The group is invalid.
 DUPLICATE_GROUP
 The group is a duplicate.
 NO_KEY
 No key was specified.
 DUPLICATE_KEY
 The key is a duplicate.
 MISSING_KEY
 The key is missing.
 DISALLOWED_KEY
 The key is not allowed.
enum  type {
  NONE, BAD_FILE, BAD_VALUE, INVALID_LINE,
  NO_GROUP, INVALID_GROUP, DUPLICATE_GROUP, NO_KEY,
  DUPLICATE_KEY, MISSING_KEY, DISALLOWED_KEY
}

Public Member Functions

 parse_error (type error, std::string const &detail)
 The constructor.
 parse_error (size_t line, type error, std::string const &detail)
 The constructor.
 parse_error (size_t line, std::string const &group, type error, std::string const &detail)
 The constructor.
 parse_error (size_t line, std::string const &group, std::string const &key, type error, std::string const &detail)
 The constructor.
 parse_error (std::string const &group, type error, std::string const &detail)
 The constructor.
 parse_error (std::string const &group, std::string const &key, type error, std::string const &detail)
 The constructor.

Static Private Member Functions

static const char * get_error (type error)
 Get a translated error string.
static std::string format_error (type error, std::string const &detail)
 Format an error message.
static std::string format_error (size_t line, type error, std::string const &detail)
 Format an error message.
static std::string format_error (size_t line, std::string const &group, type error, std::string const &detail)
 Format an error message.
static std::string format_error (size_t line, std::string const &group, std::string const &key, type error, std::string const &detail)
 Format an error message.
static std::string format_error (std::string const &group, type error, std::string const &detail)
 Format an error message.
static std::string format_error (std::string const &group, std::string const &key, type error, std::string const &detail)
 Format an error message.

Static Private Attributes

static std::map< type, const
char * > 
error_strings
 Mapping between error code and string.

Detailed Description

Parse error.


Member Enumeration Documentation

enum sbuild::parse_error::type

Enumerator:
NONE  No error occured. Used for detail only.
BAD_FILE  The file to parse couldn't be opened.
BAD_VALUE  The value could not be parsed.
INVALID_LINE  The line is invalid.
NO_GROUP  No group was specified.
INVALID_GROUP  The group is invalid.
DUPLICATE_GROUP  The group is a duplicate.
NO_KEY  No key was specified.
DUPLICATE_KEY  The key is a duplicate.
MISSING_KEY  The key is missing.
DISALLOWED_KEY  The key is not allowed.


Constructor & Destructor Documentation

sbuild::parse_error::parse_error ( type  error,
std::string const &  detail 
)

The constructor.

Parameters:
error the error code.
detail the details of the error.

sbuild::parse_error::parse_error ( size_t  line,
type  error,
std::string const &  detail 
)

The constructor.

Parameters:
line the line the error occured on.
error the error code.
detail the details of the error.

sbuild::parse_error::parse_error ( size_t  line,
std::string const &  group,
type  error,
std::string const &  detail 
)

The constructor.

Parameters:
line the line the error occured on.
group the group the error occured within.
error the error code.
detail the details of the error.

sbuild::parse_error::parse_error ( size_t  line,
std::string const &  group,
std::string const &  key,
type  error,
std::string const &  detail 
)

The constructor.

Parameters:
line the line the error occured on.
group the group the error occured within.
key the key the error occured within.
error the error code.
detail the details of the error.

sbuild::parse_error::parse_error ( std::string const &  group,
type  error,
std::string const &  detail 
)

The constructor.

Parameters:
group the group the error occured within.
error the error code.
detail the details of the error.

sbuild::parse_error::parse_error ( std::string const &  group,
std::string const &  key,
type  error,
std::string const &  detail 
)

The constructor.

Parameters:
group the group the error occured within.
key the key the error occured within.
error the error code.
detail the details of the error.


Member Function Documentation

static std::string sbuild::parse_error::format_error ( std::string const &  group,
std::string const &  key,
type  error,
std::string const &  detail 
) [static, private]

Format an error message.

Parameters:
group the group the error occured within.
key the key the error occured within.
error the error code.
detail the details of the error.

static std::string sbuild::parse_error::format_error ( std::string const &  group,
type  error,
std::string const &  detail 
) [static, private]

Format an error message.

Parameters:
group the group the error occured within.
error the error code.
detail the details of the error.

static std::string sbuild::parse_error::format_error ( size_t  line,
std::string const &  group,
std::string const &  key,
type  error,
std::string const &  detail 
) [static, private]

Format an error message.

Parameters:
line the line the error occured on.
group the group the error occured within.
key the key the error occured within.
error the error code.
detail the details of the error.

static std::string sbuild::parse_error::format_error ( size_t  line,
std::string const &  group,
type  error,
std::string const &  detail 
) [static, private]

Format an error message.

Parameters:
line the line the error occured on.
group the group the error occured within.
error the error code.
detail the details of the error.

static std::string sbuild::parse_error::format_error ( size_t  line,
type  error,
std::string const &  detail 
) [static, private]

Format an error message.

Parameters:
line the line the error occured on.
error the error code.
detail the details of the error.

static std::string sbuild::parse_error::format_error ( type  error,
std::string const &  detail 
) [static, private]

Format an error message.

Parameters:
error the error code.
detail the details of the error.

static const char* sbuild::parse_error::get_error ( type  error  )  [static, private]

Get a translated error string.

Parameters:
error the error code.
Returns:
a translated error string.


Member Data Documentation

std::map< parse_error::type, const char * > parse_error::error_strings [static, private]

Mapping between error code and string.


The documentation for this class was generated from the following files:
Generated on Mon Jun 26 12:55:57 2006 for schroot by  doxygen 1.4.7