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

MySQL++ SSQLS v2 Translator 3.2.5

Classes | Public Member Functions | Static Public Member Functions | List of all members
ParseV2::Field Class Reference

'field' directive line More...

`#include <parsev2.h>`

Inheritance diagram for ParseV2::Field:
[legend]
Collaboration diagram for ParseV2::Field:
[legend]

## Classes
class | Type
| A smart enum for converting SQL type strings to one of a relatively few types we directly support. More...

## Public Member Functions
| Field (const std::string &name, const std::string &type, bool is_unsigned=false, bool is_null=false, bool is_autoinc=false, bool is_key=false, const std::string &alias=0)
| Holds information about a SQL field declared in the SSQLS v2 language. More...
void | print (std::ostream &os) const
| Print field description out to a stream in SSQLS v2 form.
Public Member Functions inherited from ParseV2::Line
virtual | ~Line ()
| Virtual dtor, since this is a base class.

## Static Public Member Functions
static Field * | parse (const StringList &tl, bool subdirective, const File &file)
| Attempt to create a Field object from information in the passed StringList. More...
Static Public Member Functions inherited from ParseV2::Line
static Line * | parse (const StringList &tl, bool subdirective, const File &file)
| Virtual ctor, creating one of our subclass objects based on what we're passed. More...

## Additional Inherited Members
Protected Member Functions inherited from ParseV2::Line
| Line ()
| Protected ctor, to prevent instantiation.

## Detailed Description

'field' directive line

## Constructor & Destructor Documentation

## ◆ Field()

ParseV2::Field::Field | ( | const std::string & | name,
|  | const std::string & | type,
|  | bool | is_unsigned = `false`,
|  | bool | is_null = `false`,
|  | bool | is_autoinc = `false`,
|  | bool | is_key = `false`,
|  | const std::string & | alias = `0`
| ) |  |
| inline

Holds information about a SQL field declared in the SSQLS v2 language.

Parameters

  type | the field's SQL type
  is_unsigned | true if type is an integer and is unsigned
  is_null | true if field's value is nullable
  is_autoinc | true if DB automatically assigns an auto-incrementing value to this field in INSERT if it isn't specified
  is_key | true if field is part of the primary key
  name | the field's SQL name
  alias | the field's C++ name, defaulting to the SQL name

## Member Function Documentation

## ◆ parse()

ParseV2::Field * ParseV2::Field::parse | ( | const StringList & | tl,
|  | bool | subdirective,
|  | const File & | file
| ) |  |
| static

Attempt to create a Field object from information in the passed StringList.

A kind of pre-processor for the Field ctor, creating one of those objects only if the given StringList makes sense, using the values we find in that StringList as parameters to the ctor.

References ParseV2::File::parse_error().

Referenced by ParseV2::Line::parse().

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

- parsev2.h
- parsev2.cpp