cwidget 0.5.16
|
Load a file from disk; it's assumed to be ASCII for now. More...
#include <pager.h>
Public Member Functions | |
void | load_file (const std::string &filename, const char *encoding=NULL) |
Loads the given file into the pager. | |
void | load_file (const std::wstring &filename, const char *encoding) |
Attempts to convert the string to a multibyte representation and then load it; a nonconvertible string is treated as any other load failure would be. | |
void | load_file (const std::wstring &filename) |
Attempts to convert the string to a multibyte representation and then load it; a nonconvertible string is treated as any other load failure would be. | |
Static Public Member Functions | |
static util::ref_ptr< file_pager > | create () |
static util::ref_ptr< file_pager > | create (const std::string &filename, const char *encoding=NULL) |
Create a pager from a string. | |
static util::ref_ptr< file_pager > | create (const std::wstring &filename, const char *encoding=NULL) |
Attempts to convert the string to a multibyte representation and then load it; a nonconvertible string is treated as any other load failure would be. | |
static util::ref_ptr< file_pager > | create (const char *text, int len, const char *encoding=NULL) |
Create a pager from the given memory region. | |
Protected Member Functions | |
file_pager (const std::string &filename, const char *encoding=NULL) | |
file_pager (const std::wstring &filename, const char *encoding=NULL) | |
file_pager (const char *text, int len, const char *encoding=NULL) |
Load a file from disk; it's assumed to be ASCII for now.
static util::ref_ptr<file_pager> cwidget::widgets::file_pager::create | ( | const std::string & | s, |
const char * | encoding = NULL |
||
) | [inline, static] |
Create a pager from a string.
s | the text to display |
encoding | the encoding of s, or NULL to use LC_CTYPE |
Reimplemented from cwidget::widgets::pager.
static util::ref_ptr<file_pager> cwidget::widgets::file_pager::create | ( | const char * | text, |
int | len, | ||
const char * | encoding = NULL |
||
) | [inline, static] |
Create a pager from the given memory region.
text | the text to display |
len | the length of the buffer |
encoding | the encoding of text, or NULL to use LC_CTYPE |
Reimplemented from cwidget::widgets::pager.
void cwidget::widgets::file_pager::load_file | ( | const std::wstring & | filename | ) |
Attempts to convert the string to a multibyte representation and then load it; a nonconvertible string is treated as any other load failure would be.
The file is assumed to contain text in the encoding specified by LC_CTYPE.
filename | the name of the file to load |
void cwidget::widgets::file_pager::load_file | ( | const std::string & | filename, |
const char * | encoding = NULL |
||
) |
Loads the given file into the pager.
filename | the name of the file to load |
encoding | the encoding of the file's contents; if NULL, LC_CTYPE is used. |
void cwidget::widgets::file_pager::load_file | ( | const std::wstring & | filename, |
const char * | encoding | ||
) |
Attempts to convert the string to a multibyte representation and then load it; a nonconvertible string is treated as any other load failure would be.
filename | the name of the file to load |
encoding | the encoding of the file's contents; if NULL, LC_CTYPE is used. |