cwidget::widgets::file_pager Class Reference

Load a file from disk; it's assumed to be ASCII for now. More...

#include <pager.h>

Inheritance diagram for cwidget::widgets::file_pager:
cwidget::widgets::pager cwidget::widgets::widget trackable

List of all members.

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_pagercreate ()
static util::ref_ptr< file_pagercreate (const std::string &filename, const char *encoding=NULL)
 Create a pager from a string.
static util::ref_ptr< file_pagercreate (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_pagercreate (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)

Detailed Description

Load a file from disk; it's assumed to be ASCII for now.


Member Function Documentation

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.

Parameters:
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.

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.

Parameters:
s the text to display
encoding the encoding of s, 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.

Parameters:
filename the name of the file to load
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.

Parameters:
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::string &  filename,
const char *  encoding = NULL 
)

Loads the given file into the pager.

Parameters:
filename the name of the file to load
encoding the encoding of the file's contents; if NULL, LC_CTYPE is used.

The documentation for this class was generated from the following files:
Generated on Sun May 9 13:04:57 2010 for cwidget by  doxygen 1.6.3