• Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

ut_go_file.h

Go to the documentation of this file.
00001 /*
00002  * go-file.h :
00003  *
00004  * Copyright (C) 2004 Morten Welinder (terra@gnome.org)
00005  *
00006  * This program is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU General Public License
00008  * as published by the Free Software Foundation; either version 2
00009  * of the License, or (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019  * 02110-1301 USA.
00020  */
00021 #ifndef UT_GO_FILE_H
00022 #define UT_GO_FILE_H
00023 
00024 /* pre-emptive dismissal; ut_types.h is needed by just about everything,
00025  * so even if it's commented out in-file that's still a lot of work for
00026  * the preprocessor to do...
00027  */
00028 #ifndef UT_TYPES_H
00029 #include "ut_types.h"
00030 #endif
00031 
00032 #include <glib.h>
00033 #include <gsf/gsf.h>
00034 #include <time.h>
00035 
00036 G_BEGIN_DECLS
00037 
00038 typedef struct _UT_GOFilePermissions UT_GOFilePermissions;
00039 
00040 struct _UT_GOFilePermissions {
00041     gboolean owner_read;
00042     gboolean owner_write;
00043     gboolean owner_execute;
00044 
00045     gboolean group_read;
00046     gboolean group_write;
00047     gboolean group_execute;
00048 
00049     gboolean others_read;
00050     gboolean others_write;
00051     gboolean others_execute;
00052 };
00053 
00054 typedef enum {
00055     UT_GO_DOTDOT_SYNTACTIC,    /* Assume no symlinks.  */
00056     UT_GO_DOTDOT_TEST,         /* Check.  */
00057     UT_GO_DOTDOT_LEAVE         /* Leave alone.  */
00058 } UT_GODotDot;
00059 
00060 ABI_EXPORT gboolean UT_go_path_is_uri (const char * path);
00061 ABI_EXPORT gboolean UT_go_path_is_path (const char * path);
00062 
00063 ABI_EXPORT char *UT_go_filename_simplify (const char *filename, UT_GODotDot dotdot, gboolean make_absolute);
00064 ABI_EXPORT char *UT_go_url_simplify (const char *uri);
00065 
00066 ABI_EXPORT char *UT_go_filename_from_uri (const char *uri);
00067 ABI_EXPORT char *UT_go_filename_to_uri (const char *filename);
00068 
00069 ABI_EXPORT char *UT_go_url_resolve_relative (const char *ref_uri, const char *rel_uri);
00070 ABI_EXPORT char *UT_go_url_make_relative (const char *uri, const char *ref_uri);
00071 
00072 ABI_EXPORT char *UT_go_shell_arg_to_uri (const char *arg);
00073 ABI_EXPORT char *UT_go_basename_from_uri (const char *uri);
00074 ABI_EXPORT char *UT_go_dirname_from_uri (const char *uri, gboolean brief);
00075 ABI_EXPORT gboolean UT_go_directory_create (char const *uri, int mode, GError **err);
00076 ABI_EXPORT gchar const **UT_go_shell_argv_to_glib_encoding (gint argc, gchar const **argv);
00077 ABI_EXPORT void UT_go_shell_argv_to_glib_encoding_free (void);
00078 
00079 ABI_EXPORT GsfInput  *UT_go_file_open       (char const *uri, GError **err);
00080 ABI_EXPORT GsfOutput *UT_go_file_create (char const *uri, GError **err);
00081 ABI_EXPORT GSList *UT_go_file_split_urls    (char const *data);
00082 
00083 ABI_EXPORT gboolean UT_go_file_remove (char const *uri, GError **err);
00084 
00085 ABI_EXPORT gboolean UT_go_file_exists (char const *uri);
00086 
00087 ABI_EXPORT UT_GOFilePermissions *UT_go_get_file_permissions (char const *uri);
00088 ABI_EXPORT void UT_go_set_file_permissions (char const *uri, UT_GOFilePermissions * file_permissions);
00089 
00090 ABI_EXPORT time_t UT_go_file_get_date_accessed (char const *uri);
00091 ABI_EXPORT time_t UT_go_file_get_date_modified (char const *uri);
00092 ABI_EXPORT time_t UT_go_file_get_date_changed  (char const *uri);
00093 
00094 ABI_EXPORT GError   *UT_go_url_show     (gchar const *url);
00095 ABI_EXPORT gboolean UT_go_url_check_extension (gchar const *uri,
00096                  gchar const *std_ext,
00097                  gchar **new_uri);
00098 ABI_EXPORT gchar    *UT_go_get_mime_type    (gchar const *uri);
00099 ABI_EXPORT gchar    *UT_go_get_mime_type_for_data   (gconstpointer data, int data_size);
00100 ABI_EXPORT gchar const  *UT_go_mime_type_get_description    (gchar const *mime_type);
00101 
00102 ABI_EXPORT const char * UT_go_guess_encoding (const char *raw, size_t len, const char *user_guess, char **utf8_str);
00103 ABI_EXPORT char const * UT_go_get_real_name (void);
00104 ABI_EXPORT gint UT_go_utf8_collate_casefold (const char *a, const char *b);
00105 
00106 G_END_DECLS
00107 
00108 #endif /* UT_GO_FILE_H */
00109 //#endif
00110 

Generated on Thu May 23 2013 for AbiWord by  doxygen 1.7.1