gtksourceviewmm 3.91.1
|
Class which provides access to SourceLanguages. More...
#include <gtksourceviewmm/languagemanager.h>
Inherits Glib::Object.
Public Member Functions | |
LanguageManager (LanguageManager&& src) noexcept | |
LanguageManager& | operator= (LanguageManager&& src) noexcept |
~LanguageManager () noexcept override | |
GtkSourceLanguageManager* | gobj () |
Provides access to the underlying C GObject. | |
const GtkSourceLanguageManager* | gobj () const |
Provides access to the underlying C GObject. | |
GtkSourceLanguageManager* | gobj_copy () |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. | |
std::vector< std::string > | get_search_path () const |
Gets the list directories where language manager looks for language files. | |
void | set_search_path (const std::vector< std::string >& dirs) |
Sets the list of directories where the language manager looks for language files. | |
void | reset_search_path () |
Resets the list of directories where the language manager looks for language files to default. | |
std::vector< std::string > | get_language_ids () const |
Returns the ids of the available languages. | |
Glib::RefPtr< Language > | get_language (const std::string& id) |
Gets the Language identified by the given id in the language manager. | |
Glib::RefPtr< const Language > | get_language (const std::string& id) const |
Gets the Language identified by the given id in the language manager. | |
Glib::RefPtr< Language > | guess_language (const std::string& filename, const std::string& content_type) |
Picks a Language for given file name and content type, according to the information in lang files. | |
Glib::RefPtr< const Language > | guess_language (const std::string& filename, const std::string& content_type) const |
Picks a Language for given file name and content type, according to the information in lang files. | |
Glib::PropertyProxy< std::vector< std::string > > | property_search_path () |
List of directories where the language specification files (.lang) are located. | |
Glib::PropertyProxy_ReadOnly< std::vector< std::string > > | property_search_path () const |
List of directories where the language specification files (.lang) are located. | |
Glib::PropertyProxy_ReadOnly< std::vector< std::string > > | property_language_ids () const |
List of the ids of the available languages. | |
Static Public Member Functions | |
static GType | get_type () |
Get the GType for this class, for use with the underlying GObject type system. | |
static Glib::RefPtr< LanguageManager > | create () |
Creates a new language manager. | |
static Glib::RefPtr< LanguageManager > | get_default () |
Returns the default LanguageManager instance. | |
Protected Member Functions | |
LanguageManager () | |
Related Symbols | |
(Note that these are not member symbols.) | |
Glib::RefPtr< Gsv::LanguageManager > | wrap (GtkSourceLanguageManager* object, bool take_copy=false) |
A Glib::wrap() method for this object. | |
Class which provides access to SourceLanguages.
LanguageManager is a class which processes language description files and creates and stores Language objects, and provides API to access them.
Use get_default() to retrieve the default instance of LanguageManager, and guess_language() to get a Language for given file name and content type.
|
noexcept |
|
overridenoexcept |
|
protected |
|
static |
Creates a new language manager.
If you do not need more than one language manager or a private language manager instance then use get_default() instead.
|
static |
Returns the default LanguageManager instance.
Glib::RefPtr< Language > Gsv::LanguageManager::get_language | ( | const std::string & | id | ) |
Glib::RefPtr< const Language > Gsv::LanguageManager::get_language | ( | const std::string & | id | ) | const |
std::vector< std::string > Gsv::LanguageManager::get_language_ids | ( | ) | const |
Returns the ids of the available languages.
std::vector< std::string > Gsv::LanguageManager::get_search_path | ( | ) | const |
Gets the list directories where language manager looks for language files.
|
static |
Get the GType for this class, for use with the underlying GObject type system.
|
inline |
Provides access to the underlying C GObject.
|
inline |
Provides access to the underlying C GObject.
GtkSourceLanguageManager * Gsv::LanguageManager::gobj_copy | ( | ) |
Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
Glib::RefPtr< Language > Gsv::LanguageManager::guess_language | ( | const std::string & | filename, |
const std::string & | content_type ) |
Picks a Language for given file name and content type, according to the information in lang files.
Either filename or content_type may be an empty string. This function can be used as follows:
or
etc. Use get_mime_types() and get_globs() if you need full control over file -> language mapping.
filename | A filename, or empty string. |
content_type | A content type (as in GIO API), or empty string. |
Glib::RefPtr< const Language > Gsv::LanguageManager::guess_language | ( | const std::string & | filename, |
const std::string & | content_type ) const |
Picks a Language for given file name and content type, according to the information in lang files.
Either filename or content_type may be an empty string. This function can be used as follows:
or
etc. Use Language::get_mime_types() and Language::get_globs() if you need full control over file -> language mapping.
filename | A filename, or empty string. |
content_type | A content type (as in GIO API), or empty string. |
|
noexcept |
Glib::PropertyProxy_ReadOnly< std::vector< std::string > > Gsv::LanguageManager::property_language_ids | ( | ) | const |
List of the ids of the available languages.
Glib::PropertyProxy< std::vector< std::string > > Gsv::LanguageManager::property_search_path | ( | ) |
List of directories where the language specification files (.lang) are located.
Glib::PropertyProxy_ReadOnly< std::vector< std::string > > Gsv::LanguageManager::property_search_path | ( | ) | const |
List of directories where the language specification files (.lang) are located.
void Gsv::LanguageManager::reset_search_path | ( | ) |
Resets the list of directories where the language manager looks for language files to default.
void Gsv::LanguageManager::set_search_path | ( | const std::vector< std::string > & | dirs | ) |
Sets the list of directories where the language manager looks for language files.
dirs | An empty string terminated array of strings. |
|
related |
A Glib::wrap() method for this object.
object | The C instance. |
take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref. |