input operator for NoteName The format is capital or small letters for the NoteName
More...
#include <Database.hpp>
|
| 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< Data > | readAllEntries (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...
|
|
input operator for NoteName The format is capital or small letters for the NoteName
- Parameters
-
i | the stream to read from |
n | the NoteName to write in |
- Exceptions
-
std::domain_error | if not a NoteName |
- Returns
- i
Constructor of a db It scans the directory looking for available styles.
- Parameters
-
style | the name of the style we want to deal with |
void Database::addEntry |
( |
const std::string & |
style, |
|
|
const Data & |
e |
|
) |
| |
Add given entry to the given style.
- Parameters
-
style | where the entry should be added |
e | the entry itself |
- Exceptions
-
std::runtime_error | in 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
-
style | the style where the entry should be added |
fileMelody | the file where the melody is stored |
fileChords | the file where the chord progression is stored |
name | the name of the entry. |
- Exceptions
-
void Database::deleteEntry |
( |
std::string |
style, |
|
|
std::string |
name |
|
) |
| |
delete an entry in the given style
- Parameters
-
style | Name of the style |
name | Name 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
-
style | the name of the style of music. |
dataname | the 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
-
- 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
-
style | name 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: