Ipelib
|
#include <ipebase.h>
Public Types | |
typedef void(* | DebugHandler )(const char *) |
Static Public Member Functions | |
static FILE * | fopen (const char *fname, const char *mode) |
static int | libVersion () |
static void | initLib (int version) |
static void | setDebug (bool debug) |
static String | currentDirectory () |
static String | latexDirectory () |
static String | fontmapFile () |
static bool | fileExists (String fname) |
static bool | listDirectory (String path, std::vector< String > &files) |
static String | readFile (String fname) |
static int | runPdfLatex (String dir) |
static double | toDouble (String s) |
Platform dependent methods.
typedef void(* ipe::Platform::DebugHandler)(const char *) |
|
inlinestatic |
|
static |
Return the Ipelib version.
This is available as a function so that one can verify what version of Ipelib one has actually linked with (as opposed to the header files used during compilation).
References ipe::IPELIB_VERSION.
|
static |
Initialize Ipelib.
This method must be called before Ipelib is used.
It creates a LC_NUMERIC locale set to 'C', which is necessary for correct loading and saving of Ipe objects. The method also checks that the correct version of Ipelib is loaded, and aborts with an error message if the version is not correct. Also enables ipeDebug messages if environment variable IPEDEBUG is defined. (You can override this using setDebug).
References ipe::IPELIB_VERSION.
|
static |
Enable or disable display of ipeDebug messages.
|
static |
Returns current working directory.
Returns empty string if something fails.
|
static |
Returns directory for running Latex.
The directory is created if it does not exist. Returns an empty string if the directory cannot be found or cannot be created. The directory returned ends in the path separator.
References fileExists(), ipe::String::left(), ipe::String::right(), ipe::String::size(), and ipe::String::z().
Referenced by ipe::Document::runLatex().
|
static |
Returns filename of fontmap.
|
static |
List all files in directory.
Return true if successful, false on error.
References ipe::String::z().
Read entire file into string.
Returns an empty string if file cannot be found or read. There is no way to distinguish an empty file from this.
References ipe::String::append(), fopen(), and ipe::String::z().
Referenced by ipe::Bitmap::readJpeg(), and ipe::Document::runLatex().
|
static |
Runs pdflatex on file text.tex in given directory.
References fopen(), ipe::Lex::getInt(), ipe::String::size(), ipe::String::substr(), and ipe::String::z().
Referenced by ipe::Document::runLatex().
|
static |
References ipe::String::z().
Referenced by ipe::Lex::getDouble(), and ipe::PdfParser::getObject().