#include <glib.h>
#include <time.h>
#include <limits.h>
#include "ut_types.h"
#include "ut_string_class.h"
#include "ut_go_file.h"
#include "ut_rand.h"
Go to the source code of this file.
Functions | |
ABI_EXPORT const char * | UT_basename (const char *path) |
ABI_EXPORT UT_UTF8String | UT_go_basename (const char *uri) |
ABI_EXPORT std::string | UT_createTmpFile (const std::string &prefix, const std::string &extension) |
ABI_EXPORT bool | UT_directoryExists (const char *dir) |
ABI_EXPORT bool | UT_isRegularFile (const char *filename) |
ABI_EXPORT size_t | UT_fileSize (const char *filename) |
ABI_EXPORT time_t | UT_mTime (const char *path) |
ABI_EXPORT bool | UT_legalizeFileName (std::string &filename) |
ABI_EXPORT const char* UT_basename | ( | const char * | path | ) |
This function takes a char* representing a path to a file and returns the pointer to the string which represents the base portion of the path.
For example, if path = "/home/foo/bar.ext", then this function returns a char* pointing to "bar.ext".
Referenced by AP_UnixDialog_New::_constructWindow(), IE_Imp_RTF::_loadFile(), IE_Exp_PalmDoc::_writeDocument(), IE_Exp_HTML::_writeDocument(), IE_Exp_S5::_writeHeader(), Defun_EV_GetMenuItemComputedLabel_Fn(), XAP_UnixDialog_FileOpenSaveAs::fileTypeChanged(), XAP_CocoaModule::load(), XAP_ModuleManager::loadModule(), and strippath().
ABI_EXPORT std::string UT_createTmpFile | ( | const std::string & | prefix, | |
const std::string & | extension | |||
) |
References FREEP, gchar, UT_rand(), UT_return_val_if_fail, UT_UTF8String_sprintf(), and UT_UTF8String::utf8_str().
Referenced by Defun1(), and GR_Win32PrintPreviewGraphics::startPrint().
ABI_EXPORT bool UT_directoryExists | ( | const char * | dir | ) |
if dir is an existing directory, this function returns true, otherwise, it returns false
References MAX_PATH.
Referenced by XAP_AppImpl::localizeHelpUrl().
ABI_EXPORT size_t UT_fileSize | ( | const char * | filename | ) |
References UT_ASSERT, and UT_SHOULD_NOT_HAPPEN.
ABI_EXPORT UT_UTF8String UT_go_basename | ( | const char * | uri | ) |
References UT_go_basename_from_uri().
Referenced by s_XSL_FO_Listener::_handleDataItems(), s_WML_Listener::_handleDataItems(), s_DocBook_Listener::_handleDataItems(), s_XSL_FO_Listener::_handleEmbedded(), s_WML_Listener::_handleEmbedded(), s_DocBook_Listener::_handleEmbedded(), s_XSL_FO_Listener::_handleImage(), s_WML_Listener::_handleImage(), s_DocBook_Listener::_handleImage(), s_XSL_FO_Listener::_handleMath(), s_WML_Listener::_handleMath(), s_DocBook_Listener::_handleMath(), s_XSL_FO_Listener::_handlePositionedImage(), s_DocBook_Listener::_handlePositionedImage(), and IE_Exp_HTML::_writeDocument().
ABI_EXPORT bool UT_isRegularFile | ( | const char * | filename | ) |
ABI_EXPORT bool UT_legalizeFileName | ( | std::string & | filename | ) |
check that the given filename is legal and remove any illegal characters
filename | [in/out] the suggested file name |
References UT_UTF8Stringbuf::UTF8Iterator::advance(), UT_UTF8Stringbuf::charCode(), UT_UTF8Stringbuf::UTF8Iterator::current(), FREEP, UT_UTF8String::getIterator(), UT_UTF8Stringbuf::UTF8Iterator::start(), and UT_UTF8String::utf8_str().
Referenced by UT_runDialog_AskForPathname::run(), and s_AskForPathname().
ABI_EXPORT time_t UT_mTime | ( | const char * | path | ) |
If the directory/file 'path' exist its mtime (modification time) is returned
References UT_ASSERT, UT_ASSERT_HARMLESS, and UT_SHOULD_NOT_HAPPEN.