wex v24.04.0
Public Member Functions | List of all members
wex::lexer_props Class Reference

This class defines a lexer properties class. More...

#include <wex/syntax/lexer-props.h>

Inheritance diagram for wex::lexer_props:
Inheritance graph
[legend]

Public Member Functions

 lexer_props ()
 Default constructor.
 
const std::string make_comment (const std::string &comment) const
 Returns a comment string.
 
const std::string make_key (const std::string &name, const std::string &value, const std::string &comment=std::string()) const
 Returns a key value string with optional comment.
 
const std::string make_section (const std::string &section) const
 Returns a section string.
 
- Public Member Functions inherited from wex::lexer
 lexer (const std::string &lexer=std::string())
 Default constructor.
 
 lexer (syntax::stc *stc)
 Constructor using syntax stc.
 
 lexer (const pugi::xml_node *node)
 Constructor using xml node.
 
bool add_keywords (const std::string &text, int setno=0)
 Adds keywords (public for testing only).
 
const std::string align_text (const std::string_view &lines, const std::string_view &header=std::string(), bool fill_out_with_space=true, bool fill_out=false) const
 Aligns text.
 
bool apply () const
 Applies this lexer to stc component (and colours the component).
 
int attrib (const std::string &name) const
 Returns specified config attrib.
 
const auto & attribs () const
 Returns all the attribs.
 
void clear ()
 Clears lexer and applies it to stc if available.
 
const std::string comment_complete (const std::string &comment) const
 Returns a string that completes specified comment, by adding spaces and a comment end at the end.
 
const auto & comment_begin () const
 Returns the comment begin.
 
const auto & comment_begin2 () const
 Returns the comment begin 2.
 
const auto & comment_end () const
 Returns the comment end.
 
const auto & comment_end2 () const
 Returns the comment end 2.
 
const auto & display_lexer () const
 Returns the display lexer (as shown in dialog).
 
const auto & extensions () const
 Returns the extensions.
 
auto * get_stc ()
 Returns the stc.
 
bool is_keyword (const std::string &word) const
 Is this word a keyword (always all keywords), case sensitive.
 
bool is_ok () const
 Is this lexer valid.
 
bool keyword_starts_with (const std::string &word) const
 Does any keyword (always all keywords) start with this word, case insensitive.
 
const auto & keywords () const
 Returns the keywords.
 
const std::string keywords_string (int keyword_set=-1, size_t min_size=0, const std::string &prefix=std::string()) const
 Returns the keywords as one large string,.
 
const auto & language () const
 Returns the language.
 
size_t line_size () const
 Returns the line size.
 
std::stringstream log () const
 Logs info about this class.
 
const std::string make_comment (const std::string &text, bool fill_out_with_space=true, bool fill_out=true) const
 Returns a lexer comment string with text formatted.
 
const std::string make_comment (const std::string &prefix, const std::string &text) const
 Returns a lexer comment string with prefix.
 
const std::string make_single_line_comment (const std::string_view &text, bool fill_out_with_space=true, bool fill_out=true) const
 Returns a lexer comment string filled out over one line.
 
bool is_previewable () const
 Returns true if the stc component associated with this lexer can be previewed.
 
const auto & properties () const
 Returns the properties.
 
const auto & scintilla_lexer () const
 Returns the scintilla lexer.
 
bool set (const std::string &lexer, bool fold=false)
 Sets lexer to specified lexer (finds by name from lexers), Shows error message when lexer could not be set.
 
bool set (const lexer &lexer, bool fold=false)
 Sets lexer to specified lexer, and applies it to stc if present.
 
void set_property (const std::string &name, const std::string &value)
 Overrides a local property.
 
const auto & styles () const
 Returns the styles.
 
size_t usable_chars_per_line () const
 Returns number of chars that fit on a line, skipping comment chars.
 

Detailed Description

This class defines a lexer properties class.