Passwordfile library 5.0.12
C++ library to read/write passwords from/to encrypted files
Loading...
Searching...
No Matches
Io::Field Class Reference

The Field class holds field information which consists of a name and a value and is able to serialize and deserialize this information. More...

#include <field.h>

Collaboration diagram for Io::Field:
[legend]

Public Member Functions

 Field ()
 
 Field (AccountEntry *tiedAccount, const std::string &name=std::string(), const std::string &value=std::string())
 Constructs a new account entry for the specified account with the specified name and value.
 
 Field (AccountEntry *tiedAccount, std::istream &stream)
 Constructs a new account entry for the specified account which is deserialize from the specified stream.
 
bool isEmpty () const
 Returns an indication whether the entry is empty.
 
const std::string & name () const
 Returns the name.
 
void setName (const std::string &name)
 Sets the name.
 
const std::string & value () const
 Returns the value.
 
void setValue (const std::string &value)
 Sets the value.
 
FieldType type () const
 Returns the type.
 
void setType (FieldType type)
 Sets the type.
 
AccountEntrytiedAccount () const
 Returns the tied account.
 
void make (std::ostream &stream) const
 Serializes the current instance to the specified stream.
 

Static Public Member Functions

static bool isValidType (int number)
 Returns whether the specified number is a valid field type.
 

Protected Attributes

std::string m_extendedData
 

Detailed Description

The Field class holds field information which consists of a name and a value and is able to serialize and deserialize this information.

Definition at line 15 of file field.h.

Constructor & Destructor Documentation

◆ Field() [1/3]

Io::Field::Field ( )
inline

Definition at line 42 of file field.h.

◆ Field() [2/3]

Io::Field::Field ( AccountEntry * tiedAccount,
const std::string & name = std::string(),
const std::string & value = std::string() )

Constructs a new account entry for the specified account with the specified name and value.

Definition at line 22 of file field.cpp.

◆ Field() [3/3]

Io::Field::Field ( AccountEntry * tiedAccount,
std::istream & stream )

Constructs a new account entry for the specified account which is deserialize from the specified stream.

Exceptions
ThrowsParsingException when an parsing error occurs.

Definition at line 35 of file field.cpp.

Member Function Documentation

◆ isEmpty()

bool Io::Field::isEmpty ( ) const
inline

Returns an indication whether the entry is empty.

Definition at line 51 of file field.h.

◆ isValidType()

bool Io::Field::isValidType ( int number)
inlinestatic

Returns whether the specified number is a valid field type.

Definition at line 115 of file field.h.

◆ make()

void Io::Field::make ( std::ostream & stream) const

Serializes the current instance to the specified stream.

Definition at line 61 of file field.cpp.

◆ name()

const std::string & Io::Field::name ( ) const
inline

Returns the name.

Definition at line 59 of file field.h.

◆ setName()

void Io::Field::setName ( const std::string & name)
inline

Sets the name.

Definition at line 67 of file field.h.

◆ setType()

void Io::Field::setType ( FieldType type)
inline

Sets the type.

Definition at line 99 of file field.h.

◆ setValue()

void Io::Field::setValue ( const std::string & value)
inline

Sets the value.

Definition at line 83 of file field.h.

◆ tiedAccount()

AccountEntry * Io::Field::tiedAccount ( ) const
inline

Returns the tied account.

Definition at line 107 of file field.h.

◆ type()

FieldType Io::Field::type ( ) const
inline

Returns the type.

Definition at line 91 of file field.h.

◆ value()

const std::string & Io::Field::value ( ) const
inline

Returns the value.

Definition at line 75 of file field.h.

Member Data Documentation

◆ m_extendedData

std::string Io::Field::m_extendedData
protected

Definition at line 39 of file field.h.


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