bibhtml  1.0
 All Classes Functions Variables Enumerations
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
Bib Class Reference

Main class of the program. More...

Public Member Functions

BibEntryaddEntry (const std::string &bibkey, const std::string &typeName, bool isAuxiliary)
 returns an entry after creating it if needed. More...
 
void completeEntry (BibEntry &)
 post-treatment to complete the entry.
 
const BibEntrygetEntry (const std::string &bibkey) const
 Returns the entry with this bibkey.
 
void select (const std::string &query_pattern)
 Selects entries. More...
 
void sort (const std::string &sort_pattern)
 Sorts entries. More...
 
void clear ()
 Clears the entry database.
 
void readBib (const std::string &fileName, bool isAuxiliary)
 Reads a BibTex file. More...
 
void setHtmlFile (const std::string &fileName)
 Changes the name of the generated HTML file.
 
void setBibFile (const std::string &fileName)
 Changes the name of the generated BibTex file.
 
void writeHtml (bool display)
 Writes the selected entries in the generated HTML file. More...
 
void writeBib (bool display)
 Write the selected entries in the generated BibText file. More...
 
void readTemplate (const std::string &fileName)
 Reads the HTML template that serves to produce the HTML output file.
 
void setFormat (const std::string &options)
 Changes formatting options, including the printing Style.
 
void setStyle (const std::string &styleKey)
 Changes the Style (see BibStyle).
 
void checkLinks (const std::string &fieldName)
 Checks if links corresponding to this field are valid, removes them otherwise.
 
void showStats (std::string filename)
 Shows statitistics.
 
void doCommand (const std::string &cmd, const std::string &args, bool &interFound, bool &showFound)
 Executes a command.
 

Static Public Member Functions

static void echo (const std::string &msg)
 Prints a message on the console.
 
static void error (const char *command, const std::string &msg)
 Prints an error on the console.
 
static bool help ()
 Prints help on the console.
 

Static Public Attributes

static std::list< BibExtension * > extensions
 MUST BE FIRST!
 

Detailed Description

Main class of the program.

Member Function Documentation

BibEntry * Bib::addEntry ( const std::string &  bibkey,
const std::string &  typeName,
bool  isAuxiliary 
)

returns an entry after creating it if needed.

If an entry with the same bibkey already exists, it is returned without creating a new entry. Entries can have any type (the type is automatically added to BibTypes if needed). isAuxiliary should be true if this entry comes from an auxiliary file (such entries are ignored when printing HTML files).

void Bib::select ( const std::string &  query_pattern)

Selects entries.

The query syntax is: field1 & field2=value2 & field3!=value3 & field4=value4a|!value4b ... All conditions betwen "&" symbols must be met. These conditions mean:

  • field1 : field1 is unempty
  • field2=value2 : field2 contains value2
  • field3!=value3 : field3 does not contains value3
  • field4=value4a|!value4b : field4 contains value4a OR does not contain value4b Case does not matter. Field names can be abridged.
void Bib::sort ( const std::string &  sort_pattern)

Sorts entries.

Example: "-year & type"

  • sortPattern can contain one or several BibTex fields separated by the "&" symbol, meaning (in this example) that the papers that are currently selected will be sorted by year then by type.
  • The "-" symbol before "year" reverses order (greater dates first). Case does not matter. Field names can be abridged.
void Bib::readBib ( const std::string &  fileName,
bool  isAuxiliary 
)

Reads a BibTex file.

Reads all entries in this file and adds them to the entry database. Duplicate entries are merged taking into account their key. If an entry field if defined multiple times, the last version is kept. isAuxiliary must be true if this file is an auxiliary file (its entries may be merged with existing entries, otherwise they will be ignored when printing HTML files).

void Bib::writeHtml ( bool  display)

Writes the selected entries in the generated HTML file.

Displays the HTML file using the default Web browser if display is true.

Note
Writes only entries that are currently selected (not the whole entry database)
void Bib::writeBib ( bool  display)

Write the selected entries in the generated BibText file.

Displays the BibText file using the default Web browser if display is true.

Note
Writes only entries that are currently selected (not the whole entry database)

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