Generate an accompaniement for a given melody
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Database Class Reference

input operator for NoteName The format is capital or small letters for the NoteName More...

#include <Database.hpp>

Classes

class  Style
 

Public Member Functions

 Database ()
 Constructor of a db It scans the directory looking for available styles. More...
 
void addEntry (const std::string &style, const Data &e)
 Add given entry to the given style. More...
 
void addEntry (std::string style, std::string fileMelody, std::string fileChords, std::string name)
 
std::vector< std::string > listEntries (const std::string &style)
 get the name of the entries stored under the given style More...
 
Data getEntry (const std::string &name, const std::string &style) const
 
std::vector< DatareadAllEntries (const std::string &style)
 
std::vector< std::string > getAvailableStyles () const
 returns the name of the known styles More...
 
void deleteEntry (std::string style, std::string name)
 delete an entry in the given style More...
 

Detailed Description

input operator for NoteName The format is capital or small letters for the NoteName

Parameters
ithe stream to read from
nthe NoteName to write in
Exceptions
std::domain_errorif not a NoteName
Returns
i

Constructor & Destructor Documentation

Database::Database ( )

Constructor of a db It scans the directory looking for available styles.

Parameters
stylethe name of the style we want to deal with

Member Function Documentation

void Database::addEntry ( const std::string &  style,
const Data e 
)

Add given entry to the given style.

Parameters
stylewhere the entry should be added
ethe entry itself
Exceptions
std::runtime_errorin case of IO error
void Database::addEntry ( std::string  style,
std::string  fileMelody,
std::string  fileChords,
std::string  name 
)

add create and add a data to a file

Parameters
stylethe style where the entry should be added
fileMelodythe file where the melody is stored
fileChordsthe file where the chord progression is stored
namethe name of the entry.
Exceptions
std::runtime_error
void Database::deleteEntry ( std::string  style,
std::string  name 
)

delete an entry in the given style

Parameters
styleName of the style
nameName of the entry to delete
std::vector<std::string> Database::getAvailableStyles ( ) const

returns the name of the known styles

Returns
vector of string of the name of ths styles
Data Database::getEntry ( const std::string &  name,
const std::string &  style 
) const

Retrieve an entry given its name.

Parameters
stylethe name of the style of music.
datanamethe name of the entry we want to retrieve.
Returns
the entry which has this name.
std::vector<std::string> Database::listEntries ( const std::string &  style)

get the name of the entries stored under the given style

Parameters
stylename of the style
Returns
a list of name of the entries
std::vector<Data> Database::readAllEntries ( const std::string &  style)

Retrieve all the entries for the given style

Parameters
stylename of the style we want to retrieve.
Returns
the vector of the Data entries.

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