#include "ut_go_file.h"#include <gsf/gsf-impl-utils.h>#include <gsf/gsf-input.h>#include <gsf/gsf-input-impl.h>#include <gsf/gsf-output-impl.h>#include <gsf/gsf-input-memory.h>#include <gsf/gsf-output-memory.h>#include <gsf/gsf-input-stdio.h>#include <gsf/gsf-output-stdio.h>#include <glib/gstdio.h>#include <libxml/encoding.h>#include <stdio.h>#include <gsf/gsf-input-gio.h>#include <gsf/gsf-output-gio.h>#include <string>#include <string.h>#include <stdlib.h>#include <time.h>#include <unistd.h>#include "ut_types.h"Classes | |
| struct | _GsfOutputProxy |
| struct | GsfOutputProxyClass |
Defines | |
| #define | _(X) X |
| #define | GSF_OUTPUT_PROXY_TYPE (gsf_output_proxy_get_type ()) |
| #define | GSF_OUTPUT_PROXY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSF_OUTPUT_PROXY_TYPE, GsfOutputProxy)) |
| #define | GSF_IS_OUTPUT_PROXY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSF_OUTPUT_PROXY_TYPE)) |
Typedefs | |
| typedef struct _GsfOutputProxy | GsfOutputProxy |
Enumerations | |
| enum | { PROP_0, PROP_SINK } |
| enum | UT_GOFileDateType { UT_GO_FILE_DATE_TYPE_ACCESSED = 0, UT_GO_FILE_DATE_TYPE_MODIFIED, UT_GO_FILE_DATE_TYPE_CHANGED } |
Functions | |
| GsfInput * | gsf_input_memory_new_from_file (FILE *input) |
| GType | gsf_output_proxy_get_type (void) G_GNUC_CONST |
| void | gsf_output_proxy_register_type (GTypeModule *module) |
| GsfOutput * | gsf_output_proxy_new (GsfOutput *sink) |
| gsf_output_proxy_new : | |
| static gboolean | gsf_output_proxy_close (GsfOutput *object) |
| static void | gsf_output_proxy_finalize (GObject *object) |
| static gboolean | gsf_output_proxy_seek (GsfOutput *object, gsf_off_t offset, GSeekType whence) |
| static gboolean | gsf_output_proxy_write (GsfOutput *object, size_t num_bytes, guint8 const *buffer) |
| static gsf_off_t | gsf_output_proxy_vprintf (GsfOutput *object, char const *format, va_list args) G_GNUC_PRINTF(2 |
| static void | gsf_output_proxy_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) |
| static void | gsf_output_proxy_set_sink (GsfOutputProxy *proxy, GsfOutput *sink) |
| static void | gsf_output_proxy_set_property (GObject *object, guint property_id, GValue const *value, GParamSpec *pspec) |
| static void | gsf_output_proxy_init (GObject *object) |
| static void | gsf_output_proxy_class_init (GObjectClass *gobject_class) |
| GSF_CLASS (GsfOutputProxy, gsf_output_proxy, gsf_output_proxy_class_init, gsf_output_proxy_init, GSF_OUTPUT_TYPE) static gboolean is_fd_uri(const char *uri | |
| gboolean | UT_go_path_is_uri (const char *path) |
| gboolean | UT_go_path_is_path (const char *path) |
| char * | UT_go_filename_from_uri (const char *uri) |
| char * | UT_go_filename_to_uri (const char *filename) |
| char * | UT_go_filename_simplify (const char *filename, UT_GODotDot dotdot, gboolean make_absolute) |
| static char * | simplify_path (const char *uri) |
| static char * | simplify_host_path (const char *uri, size_t hstart) |
| char * | UT_go_url_simplify (const char *uri) |
| static gboolean | is_uri_relative (const char *uri) |
| static void | remove_internal_relative_components (char *uri_current) |
| static char * | make_full_uri_from_relative (const char *base_uri, const char *uri) |
| char * | UT_go_url_resolve_relative (const char *ref_uri, const char *rel_uri) |
| static char * | make_rel (const char *uri, const char *ref_uri, const char *uri_host, const char *slash) |
| char * | UT_go_url_make_relative (const char *uri, const char *ref_uri) |
| char * | UT_go_shell_arg_to_uri (const char *arg) |
| char * | UT_go_basename_from_uri (const char *uri) |
| UT_go_basename_from_uri: : | |
| char * | UT_go_dirname_from_uri (const char *uri, gboolean brief) |
| UT_go_dirname_from_uri: : | |
| gboolean | UT_go_directory_create (char const *uri, GError **error) |
| static gboolean | is_fd_uri (const char *uri, int *fd) |
| static GsfInput * | open_plain_file (const char *path, GError **err) |
| static GsfInput * | UT_go_file_open_impl (char const *uri, GError **err) |
| GsfInput * | UT_go_file_open (char const *uri, GError **err) |
| UT_go_file_open : : : GError. | |
| static GsfOutput * | gsf_output_proxy_create (GsfOutput *wrapped, char const *uri, GError **err) |
| static GsfOutput * | UT_go_file_create_impl (char const *uri, GError **err) |
| GsfOutput * | UT_go_file_create (char const *uri, GError **err) |
| gboolean | UT_go_file_remove (char const *uri, GError **err) |
| gboolean | UT_go_file_exists (char const *uri) |
| UT_GOFilePermissions * | UT_go_get_file_permissions (char const *uri) |
| void | UT_go_set_file_permissions (char const *uri, UT_GOFilePermissions *file_permissions) |
| static time_t | UT_go_file_get_date (char const *uri, UT_GOFileDateType type) |
| time_t | UT_go_file_get_date_accessed (char const *uri) |
| time_t | UT_go_file_get_date_modified (char const *uri) |
| time_t | UT_go_file_get_date_changed (char const *uri) |
| GError * | UT_go_url_show (gchar const *url) |
| gchar * | UT_go_get_mime_type (gchar const *uri) |
| gint | UT_go_utf8_collate_casefold (const char *a, const char *b) |
Variables | |
| static GsfOutputClass * | parent_class |
| int * | fd |
| #define _ | ( | X | ) | X |
| #define GSF_IS_OUTPUT_PROXY | ( | o | ) | (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSF_OUTPUT_PROXY_TYPE)) |
| #define GSF_OUTPUT_PROXY | ( | o | ) | (G_TYPE_CHECK_INSTANCE_CAST ((o), GSF_OUTPUT_PROXY_TYPE, GsfOutputProxy)) |
| #define GSF_OUTPUT_PROXY_TYPE (gsf_output_proxy_get_type ()) |
Referenced by gsf_output_proxy_new().
| typedef struct _GsfOutputProxy GsfOutputProxy |
| enum UT_GOFileDateType |
| GSF_CLASS | ( | GsfOutputProxy | , | |
| gsf_output_proxy | , | |||
| gsf_output_proxy_class_init | , | |||
| gsf_output_proxy_init | , | |||
| GSF_OUTPUT_TYPE | ||||
| ) | const |
| GsfInput* gsf_input_memory_new_from_file | ( | FILE * | input | ) |
Referenced by UT_go_file_open_impl().
| static void gsf_output_proxy_class_init | ( | GObjectClass * | gobject_class | ) | [static] |
References parent_class, and PROP_SINK.
| static gboolean gsf_output_proxy_close | ( | GsfOutput * | object | ) | [static] |
References _GsfOutputProxy::memory_output, and _GsfOutputProxy::sink.
| static GsfOutput* gsf_output_proxy_create | ( | GsfOutput * | wrapped, | |
| char const * | uri, | |||
| GError ** | err | |||
| ) | [static] |
References gsf_output_proxy_new().
Referenced by UT_go_file_create_impl().
| static void gsf_output_proxy_finalize | ( | GObject * | object | ) | [static] |
References _GsfOutputProxy::memory_output, parent_class, and _GsfOutputProxy::sink.
| static void gsf_output_proxy_get_property | ( | GObject * | object, | |
| guint | property_id, | |||
| GValue * | value, | |||
| GParamSpec * | pspec | |||
| ) | [static] |
References PROP_SINK, and _GsfOutputProxy::sink.
| GType gsf_output_proxy_get_type | ( | void | ) |
| static void gsf_output_proxy_init | ( | GObject * | object | ) | [static] |
References _GsfOutputProxy::memory_output, and _GsfOutputProxy::sink.
| GsfOutput * gsf_output_proxy_new | ( | GsfOutput * | sink | ) |
gsf_output_proxy_new :
Returns a new file or NULL.
References GSF_OUTPUT_PROXY_TYPE.
Referenced by gsf_output_proxy_create().
| void gsf_output_proxy_register_type | ( | GTypeModule * | module | ) |
| static gboolean gsf_output_proxy_seek | ( | GsfOutput * | object, | |
| gsf_off_t | offset, | |||
| GSeekType | whence | |||
| ) | [static] |
References _GsfOutputProxy::memory_output.
| static void gsf_output_proxy_set_property | ( | GObject * | object, | |
| guint | property_id, | |||
| GValue const * | value, | |||
| GParamSpec * | pspec | |||
| ) | [static] |
References gsf_output_proxy_set_sink(), and PROP_SINK.
| static void gsf_output_proxy_set_sink | ( | GsfOutputProxy * | proxy, | |
| GsfOutput * | sink | |||
| ) | [static] |
References _GsfOutputProxy::sink.
Referenced by gsf_output_proxy_set_property().
| static gsf_off_t static gsf_off_t gsf_output_proxy_vprintf | ( | GsfOutput * | object, | |
| char const * | format, | |||
| va_list | args | |||
| ) | [static] |
References _GsfOutputProxy::memory_output.
| static gboolean gsf_output_proxy_write | ( | GsfOutput * | object, | |
| size_t | num_bytes, | |||
| guint8 const * | buffer | |||
| ) | [static] |
References _GsfOutputProxy::memory_output.
| static gboolean is_fd_uri | ( | const char * | uri, | |
| int * | fd | |||
| ) | [static] |
Referenced by UT_go_file_create_impl(), UT_go_file_open_impl(), and UT_go_shell_arg_to_uri().
| static gboolean is_uri_relative | ( | const char * | uri | ) | [static] |
Referenced by UT_go_url_resolve_relative().
| static char* make_full_uri_from_relative | ( | const char * | base_uri, | |
| const char * | uri | |||
| ) | [static] |
References remove_internal_relative_components().
Referenced by UT_go_url_resolve_relative().
| static char* make_rel | ( | const char * | uri, | |
| const char * | ref_uri, | |||
| const char * | uri_host, | |||
| const char * | slash | |||
| ) | [static] |
Referenced by UT_go_url_make_relative().
| static GsfInput* open_plain_file | ( | const char * | path, | |
| GError ** | err | |||
| ) | [static] |
Referenced by UT_go_file_open_impl().
| static void remove_internal_relative_components | ( | char * | uri_current | ) | [static] |
Referenced by make_full_uri_from_relative().
| static char* simplify_host_path | ( | const char * | uri, | |
| size_t | hstart | |||
| ) | [static] |
References simplify_path().
Referenced by UT_go_url_simplify().
| static char* simplify_path | ( | const char * | uri | ) | [static] |
Referenced by simplify_host_path().
| char* UT_go_basename_from_uri | ( | const char * | uri | ) |
UT_go_basename_from_uri: :
Decode the final path component. Returns as UTF-8 encoded suitable for display.
Referenced by IE_Exp_HTML::_createChapter(), AccountHandler::_handlePacket(), XAP_FrameImpl::_updateTitle(), fp_FieldShortFileNameRun::calculateValue(), IE_Exp_HTML_NavigationHelper::getFilenameByPosition(), IE_Exp_HTML_DataExporter::IE_Exp_HTML_DataExporter(), AbiCollab::startRecording(), ServiceAccountHandler::startSession(), and UT_go_basename().
| gboolean UT_go_directory_create | ( | char const * | uri, | |
| GError ** | error | |||
| ) |
Referenced by s_XSL_FO_Listener::_handleDataItems(), s_WML_Listener::_handleDataItems(), s_DocBook_Listener::_handleDataItems(), IE_Exp_HTML_FileExporter::_init(), IE_Exp_EPUB::_writeDocument(), IE_Imp_EPUB::createFileByPath(), IE_Exp_EPUB::EPUB2_writeStructure(), IE_Exp_EPUB::EPUB3_writeStructure(), IE_Imp_EPUB::uncompress(), and IE_Exp::writeBufferToFile().
| char* UT_go_dirname_from_uri | ( | const char * | uri, | |
| gboolean | brief | |||
| ) |
UT_go_dirname_from_uri: :
: if TRUE, hide "file://" if present.
Decode the all but the final path component. Returns as UTF-8 encoded suitable for display.
References UT_go_filename_from_uri().
Referenced by s_LaTeX_Listener::_handleImage(), and XAP_UnixDialog_FileOpenSaveAs::runModal().
| GsfOutput* UT_go_file_create | ( | char const * | uri, | |
| GError ** | err | |||
| ) |
References UT_go_file_create_impl().
Referenced by IE_Exp_HTML::_createChapter(), s_XSL_FO_Listener::_handleDataItems(), s_WML_Listener::_handleDataItems(), s_KWord_1_Listener::_handleDataItems(), s_DocBook_Listener::_handleDataItems(), IE_Exp::_openFile(), IE_Imp_EPUB::createFileByPath(), AP_CocoaPlugin_FramelessDocument::exportDocumentToFile:exportOptions:, AP_UnixDialog_RDFEditor::onExportRDFXML(), FakeAccountHandler::process(), abiword_document::save(), SaveBindings_invoke(), IE_Exp_HTML_FileExporter::saveData(), AbiCollabSessionManager::storeProfile(), IE_Exp::writeBufferToFile(), and UT_ByteBuf::writeToURI().
| static GsfOutput* UT_go_file_create_impl | ( | char const * | uri, | |
| GError ** | err | |||
| ) | [static] |
References fd, gsf_output_proxy_create(), is_fd_uri(), UT_go_filename_from_uri(), and UT_go_path_is_uri().
Referenced by UT_go_file_create().
| gboolean UT_go_file_exists | ( | char const * | uri | ) |
Referenced by XAP_UnixDialog_FileOpenSaveAs::_run_gtk_main(), and IE_Imp_EPUB::createFileByPath().
| static time_t UT_go_file_get_date | ( | char const * | uri, | |
| UT_GOFileDateType | type | |||
| ) | [static] |
| time_t UT_go_file_get_date_accessed | ( | char const * | uri | ) |
References UT_GO_FILE_DATE_TYPE_ACCESSED, and UT_go_file_get_date().
| time_t UT_go_file_get_date_changed | ( | char const * | uri | ) |
References UT_GO_FILE_DATE_TYPE_CHANGED, and UT_go_file_get_date().
| time_t UT_go_file_get_date_modified | ( | char const * | uri | ) |
References UT_GO_FILE_DATE_TYPE_MODIFIED, and UT_go_file_get_date().
| GsfInput* UT_go_file_open | ( | char const * | uri, | |
| GError ** | err | |||
| ) |
UT_go_file_open : : : GError.
Try all available methods to open a file or return an error
References UT_go_file_open_impl().
Referenced by PD_Document::_importFile(), abiword_document::abiword_document(), IE_Exp_EPUB::compress(), IE_ImpGraphic::constructImporter(), IE_Imp::constructImporter(), IE_MailMerge::constructMerger(), DiskSessionRecorder::getPackets(), IE_Imp::importFile(), IE_ImpGraphic::importGraphic(), UT_ByteBuf::insertFromURI(), LoadBindings::LoadBindings(), IE_Imp::loadFile(), IE_ImpGraphic::loadGraphic(), LoadKeybindings(), AbiCollabSessionManager::loadProfile(), IE_MailMerge_Delimiter_Listener::mergeFile(), AP_UnixDialog_RDFEditor::onImportRDFXML(), XAP_UnixDialog_FileOpenSaveAs::previewPicture(), and IE_Imp_EPUB::readStructure().
| static GsfInput* UT_go_file_open_impl | ( | char const * | uri, | |
| GError ** | err | |||
| ) | [static] |
References fd, gsf_input_memory_new_from_file(), is_fd_uri(), open_plain_file(), and UT_go_filename_from_uri().
Referenced by UT_go_file_open().
| gboolean UT_go_file_remove | ( | char const * | uri, | |
| GError ** | err | |||
| ) |
References UT_go_filename_from_uri().
Referenced by IE_Exp::_abortFile(), IE_Exp::_closeFile(), IE_Exp_EPUB::_writeDocument(), IE_Exp_EPUB::compress(), and FakeAccountHandler::process().
| char* UT_go_filename_from_uri | ( | const char * | uri | ) |
Referenced by AP_Win32Dialog_New::_doChoose(), IE_Exp_OpenDocument::_openFile(), XAP_Frame::_removeAutoSaveFile(), XAP_Dialog_PluginManager::activatePlugin(), IE_Exp_EPUB::compress(), IE_MailMerge_XML_Listener::convertURI(), Defun(), Defun1(), s_AskRevertFile(), XAP_Dialog_Print::setDocumentPathname(), IE_Imp_EPUB::uncompress(), UT_go_dirname_from_uri(), UT_go_file_create_impl(), UT_go_file_get_date(), UT_go_file_open_impl(), UT_go_file_remove(), UT_go_get_file_permissions(), UT_go_set_file_permissions(), UT_go_shell_arg_to_uri(), and UT_go_url_simplify().
| char* UT_go_filename_simplify | ( | const char * | filename, | |
| UT_GODotDot | dotdot, | |||
| gboolean | make_absolute | |||
| ) |
References UT_GO_DOTDOT_SYNTACTIC, and UT_GO_DOTDOT_TEST.
Referenced by UT_go_filename_to_uri().
| char* UT_go_filename_to_uri | ( | const char * | filename | ) |
References UT_GO_DOTDOT_TEST, and UT_go_filename_simplify().
Referenced by AbiCollab_Command::_doCmdDebug(), AbiCollab_Command::_doCmdRegression(), XAP_Win32FrameImpl::_FrameWndProc(), XAP_Win32Dialog_FileOpenSaveAs::_previewPicture(), IE_Imp_PDF::_runConversion(), AP_Win32Dialog_New::_setFileName(), IE_Exp_EPUB::_writeDocument(), abi_plugin_register(), abiword_document::abiword_document(), IE_Imp_EPUB::createFileByPath(), Defun1(), DiskSessionRecorder::DiskSessionRecorder(), AP_UnixDialog_New::event_Ok(), AbiCollabSessionManager::loadProfile(), XAP_Frame::makeBackupName(), XAP_Win32Slurp::processCommand(), XAP_Win32Dialog_FileOpenSaveAs::runModal(), XAP_UnixDialog_FileOpenSaveAs::runModal(), abiword_document::save(), SaveBindings_invoke(), XAP_Prefs::startElement(), AbiCollabSessionManager::storeProfile(), IE_Imp_EPUB::uncompress(), UT_filenameToUri(), UT_go_shell_arg_to_uri(), and UT_go_url_simplify().
| UT_GOFilePermissions* UT_go_get_file_permissions | ( | char const * | uri | ) |
References UT_go_filename_from_uri().
Referenced by XAP_FrameImpl::_updateTitle().
| gchar* UT_go_get_mime_type | ( | gchar const * | uri | ) |
Referenced by IE_Exp_EPUB::getMimeType(), and s_mapMimeToUriType().
| gboolean UT_go_path_is_path | ( | const char * | path | ) |
Referenced by XAP_UnixDialog_FileOpenSaveAs::runModal().
| gboolean UT_go_path_is_uri | ( | const char * | path | ) |
Referenced by IE_Imp_RTF::_parseFldinstBlock(), XAP_Frame::_removeAutoSaveFile(), FV_View::cmdInsertHyperlink(), IE_MailMerge_XML_Listener::convertURI(), FV_View::gotoTarget(), XAP_Frame::makeBackupName(), XAP_UnixDialog_FileOpenSaveAs::runModal(), AP_Dialog_InsertHyperlink::setDoc(), XAP_Dialog_Print::setDocumentPathname(), XAP_Prefs::startElement(), UT_go_file_create_impl(), and UT_pathSuffix().
| void UT_go_set_file_permissions | ( | char const * | uri, | |
| UT_GOFilePermissions * | file_permissions | |||
| ) |
References UT_go_filename_from_uri(), and UT_UNUSED.
| char* UT_go_shell_arg_to_uri | ( | const char * | arg | ) |
References gchar, is_fd_uri(), UT_go_filename_from_uri(), UT_go_filename_to_uri(), and UT_go_url_simplify().
Referenced by AP_Convert::convertTo(), AP_App::openCmdLineFiles(), and AP_Convert::print().
| char* UT_go_url_make_relative | ( | const char * | uri, | |
| const char * | ref_uri | |||
| ) |
References make_rel().
| char* UT_go_url_resolve_relative | ( | const char * | ref_uri, | |
| const char * | rel_uri | |||
| ) |
References is_uri_relative(), make_full_uri_from_relative(), and UT_go_url_simplify().
Referenced by IE_Imp_XSL_FO::createImage(), IE_Imp_WML::createImage(), IE_Imp_DocBook::createImage(), and IE_Imp_XHTML::importImage().
| GError* UT_go_url_show | ( | gchar const * | url | ) |
References UT_Win32LocaleString::c_str(), and UT_Win32LocaleString::fromUTF8().
Referenced by XAP_UnixAppImpl::openURL(), and XAP_QtAppImpl::openURL().
| char* UT_go_url_simplify | ( | const char * | uri | ) |
References simplify_host_path(), UT_go_filename_from_uri(), and UT_go_filename_to_uri().
Referenced by UT_go_shell_arg_to_uri(), and UT_go_url_resolve_relative().
| gint UT_go_utf8_collate_casefold | ( | const char * | a, | |
| const char * | b | |||
| ) |
| int* fd |
Referenced by fp_TextRun::_lookupProperties(), fp_ForcedPageBreakRun::_lookupProperties(), fp_ForcedColumnBreakRun::_lookupProperties(), fp_FieldRun::_lookupProperties(), fp_ImageRun::_lookupProperties(), fp_FieldEndRun::_lookupProperties(), fp_FieldStartRun::_lookupProperties(), fp_ForcedLineBreakRun::_lookupProperties(), fp_TabRun::_lookupProperties(), fp_FieldRun::fp_FieldRun(), FV_UnixVisualDrag::mouseDrag(), FV_UnixVisualInlineImage::mouseDrag(), FV_UnixFrameEdit::mouseDrag(), UT_go_file_create_impl(), and UT_go_file_open_impl().
GsfOutputClass* parent_class [static] |
Referenced by gsf_output_proxy_class_init(), and gsf_output_proxy_finalize().
1.7.1