OpenCPN Partial API docs
Loading...
Searching...
No Matches
ocpn Namespace Reference

Standard, mostly strings utilities. More...

Functions

bool endswith (const std::string &str, const std::string &suffix)
 
bool startswith (const std::string &str, const std::string &prefix)
 
std::vector< std::string > split (const char *token_string, const std::string &delimiter)
 
bool exists (const std::string &name)
 
void mkdir (const std::string path)
 
std::string ltrim (std::string s)
 
std::string rtrim (std::string s)
 
std::string trim (std::string s)
 
std::string join (std::vector< std::string > v, char c)
 
std::string tolower (const std::string &input)
 
bool replace (std::string &str, const std::string &from, const std::string &to)
 
void copy_file (const std::string &src_path, const std::string &dest_path)
 
std::string get_basename (const char *path)
 
bool store_metadata (const char *path)
 Store metadata in metadata cache, return success/fail. More...
 
std::string lookup_metadata (const char *name=0)
 Get metadata path for a given name defaulting to ocpn-plugins.xml) More...
 
bool store_tarball (const char *path, const char *basename)
 Store a tarball in tarball cache, return success/fail. More...
 
std::string lookup_tarball (const char *basename)
 Get path to tarball in cache for given filename. More...
 
unsigned cache_file_count ()
 Return number of files in cache. More...
 
unsigned long cache_size ()
 Return total size of files in cache in kbytes. More...
 
void cache_clear ()
 Remove all files in cache: More...
 

Detailed Description

Standard, mostly strings utilities.

Function Documentation

◆ cache_clear()

void ocpn::cache_clear ( )

Remove all files in cache:

Definition at line 164 of file plugin_cache.cpp.

◆ cache_file_count()

unsigned ocpn::cache_file_count ( )

Return number of files in cache.

Definition at line 116 of file plugin_cache.cpp.

◆ cache_size()

unsigned long ocpn::cache_size ( )

Return total size of files in cache in kbytes.

Definition at line 133 of file plugin_cache.cpp.

◆ copy_file()

void ocpn::copy_file ( const std::string &  src_path,
const std::string &  dest_path 
)

Definition at line 133 of file ocpn_utils.cpp.

◆ endswith()

bool ocpn::endswith ( const std::string &  str,
const std::string &  suffix 
)

Definition at line 43 of file ocpn_utils.cpp.

◆ exists()

bool ocpn::exists ( const std::string &  name)

Definition at line 68 of file ocpn_utils.cpp.

◆ get_basename()

std::string ocpn::get_basename ( const char *  path)

Definition at line 69 of file plugin_cache.cpp.

◆ join()

std::string ocpn::join ( std::vector< std::string >  v,
char  c 
)

Definition at line 109 of file ocpn_utils.cpp.

◆ lookup_metadata()

std::string ocpn::lookup_metadata ( const char *  name = 0)

Get metadata path for a given name defaulting to ocpn-plugins.xml)

Returns
Path to cached metadata or "" if not found

Definition at line 94 of file plugin_cache.cpp.

◆ lookup_tarball()

std::string ocpn::lookup_tarball ( const char *  basename)

Get path to tarball in cache for given filename.

Returns
Path to cached metadata or "" if not found

Definition at line 110 of file plugin_cache.cpp.

◆ ltrim()

std::string ocpn::ltrim ( std::string  s)

Definition at line 86 of file ocpn_utils.cpp.

◆ mkdir()

void ocpn::mkdir ( const std::string  path)

Definition at line 76 of file ocpn_utils.cpp.

◆ replace()

bool ocpn::replace ( std::string &  str,
const std::string &  from,
const std::string &  to 
)

Definition at line 126 of file ocpn_utils.cpp.

◆ rtrim()

std::string ocpn::rtrim ( std::string  s)

Definition at line 94 of file ocpn_utils.cpp.

◆ split()

std::vector< std::string > ocpn::split ( const char *  token_string,
const std::string &  delimiter 
)

Definition at line 53 of file ocpn_utils.cpp.

◆ startswith()

bool ocpn::startswith ( const std::string &  str,
const std::string &  prefix 
)

Definition at line 48 of file ocpn_utils.cpp.

◆ store_metadata()

bool ocpn::store_metadata ( const char *  path)

Store metadata in metadata cache, return success/fail.

Definition at line 85 of file plugin_cache.cpp.

◆ store_tarball()

bool ocpn::store_tarball ( const char *  path,
const char *  basename 
)

Store a tarball in tarball cache, return success/fail.

Definition at line 102 of file plugin_cache.cpp.

◆ tolower()

std::string ocpn::tolower ( const std::string &  input)

Definition at line 120 of file ocpn_utils.cpp.

◆ trim()

std::string ocpn::trim ( std::string  s)

Definition at line 103 of file ocpn_utils.cpp.