edbee - Qt Editor Library
Public Member Functions | Protected Member Functions | Friends | List of all members
edbee::TextGrammarManager Class Reference

This class is used to manage all 'grammers' used by the lexers. More...

#include <textgrammar.h>

+ Collaboration diagram for edbee::TextGrammarManager:

Public Member Functions

TextGrammarreadGrammarFile (const QString &file)
 This method reads the given grammar file and adds it to the grammar manager. The grammar manager stays the owner of the grammar file. More...
 
void readAllGrammarFilesInPath (const QString &path)
 reads all grammar files in the given path More...
 
TextGrammarget (const QString &name)
 This method returns the given language grammar. More...
 
void giveGrammar (TextGrammar *grammar)
 This method gives a language grammar to the document. More...
 
QList< QString > grammarNames ()
 This method returns all grammar names. More...
 
QList< TextGrammar * > grammars ()
 This method returns the values. More...
 
QList< TextGrammar * > grammarsSortedByDisplayName ()
 This utility function returns all grammars sorted on displayname Warning, this method sorts the grammars so calling this method multiple times is not what you want to do. More...
 
TextGrammardefaultGrammar ()
 
TextGrammardetectGrammarWithFilename (const QString &fileName)
 this method detects the grammar with a given filename More...
 
QString lastErrorMessage () const
 returns the grammar manager More...
 

Protected Member Functions

 TextGrammarManager ()
 The text grammar manager constructor. More...
 
virtual ~TextGrammarManager ()
 The detstructor (deletes all grammars) More...
 

Friends

class Edbee
 

Detailed Description

This class is used to manage all 'grammers' used by the lexers.

Constructor & Destructor Documentation

◆ TextGrammarManager()

edbee::TextGrammarManager::TextGrammarManager ( )
protected

The text grammar manager constructor.

◆ ~TextGrammarManager()

edbee::TextGrammarManager::~TextGrammarManager ( )
protectedvirtual

The detstructor (deletes all grammars)

Member Function Documentation

◆ defaultGrammar()

TextGrammar* edbee::TextGrammarManager::defaultGrammar ( )
inline

◆ detectGrammarWithFilename()

TextGrammar * edbee::TextGrammarManager::detectGrammarWithFilename ( const QString &  fileName)

this method detects the grammar with a given filename

Parameters
fileNamethe filename to detect the grammar
Returns
the defaultGrammar if no grammar was found

◆ get()

TextGrammar * edbee::TextGrammarManager::get ( const QString &  name)

This method returns the given language grammar.

◆ giveGrammar()

void edbee::TextGrammarManager::giveGrammar ( TextGrammar grammar)

This method gives a language grammar to the document.

Parameters
grammarthe grammar to give

◆ grammarNames()

QList< QString > edbee::TextGrammarManager::grammarNames ( )

This method returns all grammar names.

◆ grammars()

QList< TextGrammar * > edbee::TextGrammarManager::grammars ( )

This method returns the values.

◆ grammarsSortedByDisplayName()

QList< TextGrammar * > edbee::TextGrammarManager::grammarsSortedByDisplayName ( )

This utility function returns all grammars sorted on displayname Warning, this method sorts the grammars so calling this method multiple times is not what you want to do.

Returns
the list of grammars sorted on displayname

◆ lastErrorMessage()

QString edbee::TextGrammarManager::lastErrorMessage ( ) const

returns the grammar manager

Returns
the last error message

◆ readAllGrammarFilesInPath()

void edbee::TextGrammarManager::readAllGrammarFilesInPath ( const QString &  path)

reads all grammar files in the given path

Parameters
paththe path to read all grammar files from

◆ readGrammarFile()

TextGrammar * edbee::TextGrammarManager::readGrammarFile ( const QString &  file)

This method reads the given grammar file and adds it to the grammar manager. The grammar manager stays the owner of the grammar file.

Parameters
filenamethe direct filename to read
Returns
the TextGrammar file. When an error happend, the errorMessage is set

Friends And Related Function Documentation

◆ Edbee

friend class Edbee
friend

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