wex v24.10.0
Public Types | Public Member Functions | Protected Member Functions | List of all members
wex::factory::link Class Reference

Offers a class holding info about a link. More...

#include <wex/factory/link.h>

Inheritance diagram for wex::factory::link:
Inheritance graph
[legend]

Public Types

enum  { LINE_OPEN_URL = -2 , LINE_OPEN_MIME = -3 }
 line number to be used for line_data Afterwards line and col from data are filled in if possible. More...
 

Public Member Functions

 link ()
 Default constructor, initializes paths from config.
 
virtual ~link ()
 Destructor.
 
bool add_path (const path &p)
 Adds a search path.
 
void config_get ()
 Sets paths with info from config.
 
virtual const path get_path (const std::string &text, line_data &data, factory::stc *stc=nullptr)
 Returns a path from text, using paths if necessary, returns empty path if no path could be found.
 

Protected Member Functions

virtual std::string get_link_pairs (const std::string &text) const
 Returns text between link pairs, or empty string if none found.
 

Detailed Description

Offers a class holding info about a link.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum

line number to be used for line_data Afterwards line and col from data are filled in if possible.

Enumerator
LINE_OPEN_URL 

open url

LINE_OPEN_MIME 

open mime

Member Function Documentation

◆ add_path()

bool wex::factory::link::add_path ( const path & p)

Adds a search path.

Returns false if path does not exist, or is already present.

◆ config_get()

void wex::factory::link::config_get ( )

Sets paths with info from config.

If there is no config, paths will be empty.

◆ get_path()

virtual const path wex::factory::link::get_path ( const std::string & text,
line_data & data,
factory::stc * stc = nullptr )
virtual

Returns a path from text, using paths if necessary, returns empty path if no path could be found.

Parameters
texttext containing a path somewhere
datadata to be filled in
stcstc component

Reimplemented in wex::link.