| 1 |
/* |
|---|
| 2 |
* This file is part of gtkD. |
|---|
| 3 |
* |
|---|
| 4 |
* gtkD is free software; you can redistribute it and/or modify |
|---|
| 5 |
* it under the terms of the GNU Lesser General Public License |
|---|
| 6 |
* as published by the Free Software Foundation; either version 3 |
|---|
| 7 |
* of the License, or (at your option) any later version, with |
|---|
| 8 |
* some exceptions, please read the COPYING file. |
|---|
| 9 |
* |
|---|
| 10 |
* gtkD is distributed in the hope that it will be useful, |
|---|
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 13 |
* GNU Lesser General Public License for more details. |
|---|
| 14 |
* |
|---|
| 15 |
* You should have received a copy of the GNU Lesser General Public License |
|---|
| 16 |
* along with gtkD; if not, write to the Free Software |
|---|
| 17 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA |
|---|
| 18 |
*/ |
|---|
| 19 |
|
|---|
| 20 |
// generated automatically - do not change |
|---|
| 21 |
// find conversion definition on APILookup.txt |
|---|
| 22 |
// implement new conversion functionalities on the wrap.utils pakage |
|---|
| 23 |
|
|---|
| 24 |
/* |
|---|
| 25 |
* Conversion parameters: |
|---|
| 26 |
* inFile = GFileInfo.html |
|---|
| 27 |
* outPack = gio |
|---|
| 28 |
* outFile = FileInfo |
|---|
| 29 |
* strct = GFileInfo |
|---|
| 30 |
* realStrct= |
|---|
| 31 |
* ctorStrct= |
|---|
| 32 |
* clss = FileInfo |
|---|
| 33 |
* interf = |
|---|
| 34 |
* class Code: No |
|---|
| 35 |
* interface Code: No |
|---|
| 36 |
* template for: |
|---|
| 37 |
* extend = GObject |
|---|
| 38 |
* implements: |
|---|
| 39 |
* prefixes: |
|---|
| 40 |
* - g_file_info_ |
|---|
| 41 |
* omit structs: |
|---|
| 42 |
* omit prefixes: |
|---|
| 43 |
* - g_file_attribute_matcher_ |
|---|
| 44 |
* omit code: |
|---|
| 45 |
* omit signals: |
|---|
| 46 |
* imports: |
|---|
| 47 |
* - glib.Str |
|---|
| 48 |
* - glib.TimeVal |
|---|
| 49 |
* - gobject.ObjectG |
|---|
| 50 |
* - gio.Icon |
|---|
| 51 |
* - gio.IconIF |
|---|
| 52 |
* - gio.FileAttributeMatcher |
|---|
| 53 |
* structWrap: |
|---|
| 54 |
* - GFileAttributeMatcher* -> FileAttributeMatcher |
|---|
| 55 |
* - GFileInfo* -> FileInfo |
|---|
| 56 |
* - GIcon* -> IconIF |
|---|
| 57 |
* - GObject* -> ObjectG |
|---|
| 58 |
* - GTimeVal* -> TimeVal |
|---|
| 59 |
* module aliases: |
|---|
| 60 |
* local aliases: |
|---|
| 61 |
* overrides: |
|---|
| 62 |
*/ |
|---|
| 63 |
|
|---|
| 64 |
module gio.FileInfo; |
|---|
| 65 |
|
|---|
| 66 |
public import gtkc.giotypes; |
|---|
| 67 |
|
|---|
| 68 |
private import gtkc.gio; |
|---|
| 69 |
private import glib.ConstructionException; |
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
private import glib.Str; |
|---|
| 73 |
private import glib.TimeVal; |
|---|
| 74 |
private import gobject.ObjectG; |
|---|
| 75 |
private import gio.Icon; |
|---|
| 76 |
private import gio.IconIF; |
|---|
| 77 |
private import gio.FileAttributeMatcher; |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
private import gobject.ObjectG; |
|---|
| 82 |
|
|---|
| 83 |
/** |
|---|
| 84 |
* Description |
|---|
| 85 |
* Functionality for manipulating basic metadata for files. GFileInfo |
|---|
| 86 |
* implements methods for getting information that all files should |
|---|
| 87 |
* contain, and allows for manipulation of extended attributes. |
|---|
| 88 |
* See GFileAttribute for more |
|---|
| 89 |
* information on how GIO handles file attributes. |
|---|
| 90 |
* To obtain a GFileInfo for a GFile, use g_file_query_info() (or its |
|---|
| 91 |
* async variant). To obtain a GFileInfo for a file input or output |
|---|
| 92 |
* stream, use g_file_input_stream_query_info() or |
|---|
| 93 |
* g_file_output_stream_query_info() (or their async variants). |
|---|
| 94 |
* To change the actual attributes of a file, you should then set the |
|---|
| 95 |
* attribute in the GFileInfo and call g_file_set_attributes_from_info() |
|---|
| 96 |
* or g_file_set_attributes_async() on a GFile. |
|---|
| 97 |
* However, not all attributes can be changed in the file. For instance, |
|---|
| 98 |
* the actual size of a file cannot be changed via g_file_info_set_size(). |
|---|
| 99 |
* You may call g_file_query_settable_attributes() and |
|---|
| 100 |
* g_file_query_writable_namespaces() to discover the settable attributes |
|---|
| 101 |
* of a particular file at runtime. |
|---|
| 102 |
* GFileAttributeMatcher allows for searching through a GFileInfo for |
|---|
| 103 |
* attributes. |
|---|
| 104 |
*/ |
|---|
| 105 |
public class FileInfo : ObjectG |
|---|
| 106 |
{ |
|---|
| 107 |
|
|---|
| 108 |
/** the main Gtk struct */ |
|---|
| 109 |
protected GFileInfo* gFileInfo; |
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
public GFileInfo* getFileInfoStruct() |
|---|
| 113 |
{ |
|---|
| 114 |
return gFileInfo; |
|---|
| 115 |
} |
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
/** the main Gtk struct as a void* */ |
|---|
| 119 |
protected override void* getStruct() |
|---|
| 120 |
{ |
|---|
| 121 |
return cast(void*)gFileInfo; |
|---|
| 122 |
} |
|---|
| 123 |
|
|---|
| 124 |
/** |
|---|
| 125 |
* Sets our main struct and passes it to the parent class |
|---|
| 126 |
*/ |
|---|
| 127 |
public this (GFileInfo* gFileInfo) |
|---|
| 128 |
{ |
|---|
| 129 |
if(gFileInfo is null) |
|---|
| 130 |
{ |
|---|
| 131 |
this = null; |
|---|
| 132 |
return; |
|---|
| 133 |
} |
|---|
| 134 |
//Check if there already is a D object for this gtk struct |
|---|
| 135 |
void* ptr = getDObject(cast(GObject*)gFileInfo); |
|---|
| 136 |
if( ptr !is null ) |
|---|
| 137 |
{ |
|---|
| 138 |
this = cast(FileInfo)ptr; |
|---|
| 139 |
return; |
|---|
| 140 |
} |
|---|
| 141 |
super(cast(GObject*)gFileInfo); |
|---|
| 142 |
this.gFileInfo = gFileInfo; |
|---|
| 143 |
} |
|---|
| 144 |
|
|---|
| 145 |
protected override void setStruct(GObject* obj) |
|---|
| 146 |
{ |
|---|
| 147 |
super.setStruct(obj); |
|---|
| 148 |
gFileInfo = cast(GFileInfo*)obj; |
|---|
| 149 |
} |
|---|
| 150 |
|
|---|
| 151 |
/** |
|---|
| 152 |
*/ |
|---|
| 153 |
|
|---|
| 154 |
/** |
|---|
| 155 |
* Creates a new file info structure. |
|---|
| 156 |
* Throws: ConstructionException GTK+ fails to create the object. |
|---|
| 157 |
*/ |
|---|
| 158 |
public this () |
|---|
| 159 |
{ |
|---|
| 160 |
// GFileInfo * g_file_info_new (void); |
|---|
| 161 |
auto p = g_file_info_new(); |
|---|
| 162 |
if(p is null) |
|---|
| 163 |
{ |
|---|
| 164 |
throw new ConstructionException("null returned by g_file_info_new()"); |
|---|
| 165 |
} |
|---|
| 166 |
this(cast(GFileInfo*) p); |
|---|
| 167 |
} |
|---|
| 168 |
|
|---|
| 169 |
/** |
|---|
| 170 |
* Duplicates a file info structure. |
|---|
| 171 |
* Returns: a duplicate GFileInfo of other. [transfer full] |
|---|
| 172 |
*/ |
|---|
| 173 |
public FileInfo dup() |
|---|
| 174 |
{ |
|---|
| 175 |
// GFileInfo * g_file_info_dup (GFileInfo *other); |
|---|
| 176 |
auto p = g_file_info_dup(gFileInfo); |
|---|
| 177 |
if(p is null) |
|---|
| 178 |
{ |
|---|
| 179 |
return null; |
|---|
| 180 |
} |
|---|
| 181 |
return new FileInfo(cast(GFileInfo*) p); |
|---|
| 182 |
} |
|---|
| 183 |
|
|---|
| 184 |
/** |
|---|
| 185 |
* Copies all of the GFileAttributes from src_info to dest_info. |
|---|
| 186 |
* Params: |
|---|
| 187 |
* destInfo = destination to copy attributes to. |
|---|
| 188 |
*/ |
|---|
| 189 |
public void copyInto(FileInfo destInfo) |
|---|
| 190 |
{ |
|---|
| 191 |
// void g_file_info_copy_into (GFileInfo *src_info, GFileInfo *dest_info); |
|---|
| 192 |
g_file_info_copy_into(gFileInfo, (destInfo is null) ? null : destInfo.getFileInfoStruct()); |
|---|
| 193 |
} |
|---|
| 194 |
|
|---|
| 195 |
/** |
|---|
| 196 |
* Checks if a file info structure has an attribute named attribute. |
|---|
| 197 |
* Params: |
|---|
| 198 |
* attribute = a file attribute key. |
|---|
| 199 |
* Returns: TRUE if Ginfo has an attribute named attribute, FALSE otherwise. |
|---|
| 200 |
*/ |
|---|
| 201 |
public int hasAttribute(string attribute) |
|---|
| 202 |
{ |
|---|
| 203 |
// gboolean g_file_info_has_attribute (GFileInfo *info, const char *attribute); |
|---|
| 204 |
return g_file_info_has_attribute(gFileInfo, Str.toStringz(attribute)); |
|---|
| 205 |
} |
|---|
| 206 |
|
|---|
| 207 |
/** |
|---|
| 208 |
* Checks if a file info structure has an attribute in the |
|---|
| 209 |
* specified name_space. |
|---|
| 210 |
* Since 2.22 |
|---|
| 211 |
* Params: |
|---|
| 212 |
* nameSpace = a file attribute namespace. |
|---|
| 213 |
* Returns: TRUE if Ginfo has an attribute in name_space, FALSE otherwise. |
|---|
| 214 |
*/ |
|---|
| 215 |
public int hasNamespace(string nameSpace) |
|---|
| 216 |
{ |
|---|
| 217 |
// gboolean g_file_info_has_namespace (GFileInfo *info, const char *name_space); |
|---|
| 218 |
return g_file_info_has_namespace(gFileInfo, Str.toStringz(nameSpace)); |
|---|
| 219 |
} |
|---|
| 220 |
|
|---|
| 221 |
/** |
|---|
| 222 |
* Lists the file info structure's attributes. |
|---|
| 223 |
* Params: |
|---|
| 224 |
* nameSpace = a file attribute key's namespace. |
|---|
| 225 |
* Returns: a null-terminated array of strings of all of the possible attribute types for the given name_space, or NULL on error. [array zero-terminated=1][transfer full] |
|---|
| 226 |
*/ |
|---|
| 227 |
public string[] listAttributes(string nameSpace) |
|---|
| 228 |
{ |
|---|
| 229 |
// char ** g_file_info_list_attributes (GFileInfo *info, const char *name_space); |
|---|
| 230 |
return Str.toStringArray(g_file_info_list_attributes(gFileInfo, Str.toStringz(nameSpace))); |
|---|
| 231 |
} |
|---|
| 232 |
|
|---|
| 233 |
/** |
|---|
| 234 |
* Gets the attribute type for an attribute key. |
|---|
| 235 |
* Params: |
|---|
| 236 |
* attribute = a file attribute key. |
|---|
| 237 |
* Returns: a GFileAttributeType for the given attribute, or G_FILE_ATTRIBUTE_TYPE_INVALID if the key is not set. |
|---|
| 238 |
*/ |
|---|
| 239 |
public GFileAttributeType getAttributeType(string attribute) |
|---|
| 240 |
{ |
|---|
| 241 |
// GFileAttributeType g_file_info_get_attribute_type (GFileInfo *info, const char *attribute); |
|---|
| 242 |
return g_file_info_get_attribute_type(gFileInfo, Str.toStringz(attribute)); |
|---|
| 243 |
} |
|---|
| 244 |
|
|---|
| 245 |
/** |
|---|
| 246 |
* Removes all cases of attribute from info if it exists. |
|---|
| 247 |
* Params: |
|---|
| 248 |
* attribute = a file attribute key. |
|---|
| 249 |
*/ |
|---|
| 250 |
public void removeAttribute(string attribute) |
|---|
| 251 |
{ |
|---|
| 252 |
// void g_file_info_remove_attribute (GFileInfo *info, const char *attribute); |
|---|
| 253 |
g_file_info_remove_attribute(gFileInfo, Str.toStringz(attribute)); |
|---|
| 254 |
} |
|---|
| 255 |
|
|---|
| 256 |
/** |
|---|
| 257 |
* Gets the value of a attribute, formated as a string. |
|---|
| 258 |
* This escapes things as needed to make the string valid |
|---|
| 259 |
* utf8. |
|---|
| 260 |
* Params: |
|---|
| 261 |
* attribute = a file attribute key. |
|---|
| 262 |
* Returns: a UTF-8 string associated with the given attribute. When you're done with the string it must be freed with g_free(). |
|---|
| 263 |
*/ |
|---|
| 264 |
public string getAttributeAsString(string attribute) |
|---|
| 265 |
{ |
|---|
| 266 |
// char * g_file_info_get_attribute_as_string (GFileInfo *info, const char *attribute); |
|---|
| 267 |
return Str.toString(g_file_info_get_attribute_as_string(gFileInfo, Str.toStringz(attribute))); |
|---|
| 268 |
} |
|---|
| 269 |
|
|---|
| 270 |
/** |
|---|
| 271 |
* Gets the attribute type, value and status for an attribute key. |
|---|
| 272 |
* Params: |
|---|
| 273 |
* attribute = a file attribute key |
|---|
| 274 |
* type = return location for the attribute type, or NULL. [out][allow-none] |
|---|
| 275 |
* valuePp = return location for the attribute value, or NULL. [out][allow-none] |
|---|
| 276 |
* status = return location for the attribute status, or NULL. [out][allow-none] |
|---|
| 277 |
* Returns: TRUE if info has an attribute named attribute, FALSE otherwise. [transfer none] |
|---|
| 278 |
*/ |
|---|
| 279 |
public int getAttributeData(string attribute, out GFileAttributeType type, out void* valuePp, out GFileAttributeStatus status) |
|---|
| 280 |
{ |
|---|
| 281 |
// gboolean g_file_info_get_attribute_data (GFileInfo *info, const char *attribute, GFileAttributeType *type, gpointer *value_pp, GFileAttributeStatus *status); |
|---|
| 282 |
return g_file_info_get_attribute_data(gFileInfo, Str.toStringz(attribute), &type, &valuePp, &status); |
|---|
| 283 |
} |
|---|
| 284 |
|
|---|
| 285 |
/** |
|---|
| 286 |
* Gets the attribute status for an attribute key. |
|---|
| 287 |
* Params: |
|---|
| 288 |
* attribute = a file attribute key |
|---|
| 289 |
* Returns: a GFileAttributeStatus for the given attribute, or G_FILE_ATTRIBUTE_STATUS_UNSET if the key is invalid. |
|---|
| 290 |
*/ |
|---|
| 291 |
public GFileAttributeStatus getAttributeStatus(string attribute) |
|---|
| 292 |
{ |
|---|
| 293 |
// GFileAttributeStatus g_file_info_get_attribute_status (GFileInfo *info, const char *attribute); |
|---|
| 294 |
return g_file_info_get_attribute_status(gFileInfo, Str.toStringz(attribute)); |
|---|
| 295 |
} |
|---|
| 296 |
|
|---|
| 297 |
/** |
|---|
| 298 |
* Gets the value of a string attribute. If the attribute does |
|---|
| 299 |
* not contain a string, NULL will be returned. |
|---|
| 300 |
* Params: |
|---|
| 301 |
* attribute = a file attribute key. |
|---|
| 302 |
* Returns: the contents of the attribute value as a string, or NULL otherwise. |
|---|
| 303 |
*/ |
|---|
| 304 |
public string getAttributeString(string attribute) |
|---|
| 305 |
{ |
|---|
| 306 |
// const char * g_file_info_get_attribute_string (GFileInfo *info, const char *attribute); |
|---|
| 307 |
return Str.toString(g_file_info_get_attribute_string(gFileInfo, Str.toStringz(attribute))); |
|---|
| 308 |
} |
|---|
| 309 |
|
|---|
| 310 |
/** |
|---|
| 311 |
* Gets the value of a stringv attribute. If the attribute does |
|---|
| 312 |
* not contain a stringv, NULL will be returned. |
|---|
| 313 |
* Since 2.22 |
|---|
| 314 |
* Params: |
|---|
| 315 |
* attribute = a file attribute key. |
|---|
| 316 |
* Returns: the contents of the attribute value as a stringv, or NULL otherwise. Do not free. [transfer none] |
|---|
| 317 |
*/ |
|---|
| 318 |
public string[] getAttributeStringv(string attribute) |
|---|
| 319 |
{ |
|---|
| 320 |
// char ** g_file_info_get_attribute_stringv (GFileInfo *info, const char *attribute); |
|---|
| 321 |
return Str.toStringArray(g_file_info_get_attribute_stringv(gFileInfo, Str.toStringz(attribute))); |
|---|
| 322 |
} |
|---|
| 323 |
|
|---|
| 324 |
/** |
|---|
| 325 |
* Gets the value of a byte string attribute. If the attribute does |
|---|
| 326 |
* not contain a byte string, NULL will be returned. |
|---|
| 327 |
* Params: |
|---|
| 328 |
* attribute = a file attribute key. |
|---|
| 329 |
* Returns: the contents of the attribute value as a byte string, or NULL otherwise. |
|---|
| 330 |
*/ |
|---|
| 331 |
public string getAttributeByteString(string attribute) |
|---|
| 332 |
{ |
|---|
| 333 |
// const char * g_file_info_get_attribute_byte_string (GFileInfo *info, const char *attribute); |
|---|
| 334 |
return Str.toString(g_file_info_get_attribute_byte_string(gFileInfo, Str.toStringz(attribute))); |
|---|
| 335 |
} |
|---|
| 336 |
|
|---|
| 337 |
/** |
|---|
| 338 |
* Gets the value of a boolean attribute. If the attribute does not |
|---|
| 339 |
* contain a boolean value, FALSE will be returned. |
|---|
| 340 |
* Params: |
|---|
| 341 |
* attribute = a file attribute key. |
|---|
| 342 |
* Returns: the boolean value contained within the attribute. |
|---|
| 343 |
*/ |
|---|
| 344 |
public int getAttributeBoolean(string attribute) |
|---|
| 345 |
{ |
|---|
| 346 |
// gboolean g_file_info_get_attribute_boolean (GFileInfo *info, const char *attribute); |
|---|
| 347 |
return g_file_info_get_attribute_boolean(gFileInfo, Str.toStringz(attribute)); |
|---|
| 348 |
} |
|---|
| 349 |
|
|---|
| 350 |
/** |
|---|
| 351 |
* Gets an unsigned 32-bit integer contained within the attribute. If the |
|---|
| 352 |
* attribute does not contain an unsigned 32-bit integer, or is invalid, |
|---|
| 353 |
* 0 will be returned. |
|---|
| 354 |
* Params: |
|---|
| 355 |
* attribute = a file attribute key. |
|---|
| 356 |
* Returns: an unsigned 32-bit integer from the attribute. |
|---|
| 357 |
*/ |
|---|
| 358 |
public uint getAttributeUint32(string attribute) |
|---|
| 359 |
{ |
|---|
| 360 |
// guint32 g_file_info_get_attribute_uint32 (GFileInfo *info, const char *attribute); |
|---|
| 361 |
return g_file_info_get_attribute_uint32(gFileInfo, Str.toStringz(attribute)); |
|---|
| 362 |
} |
|---|
| 363 |
|
|---|
| 364 |
/** |
|---|
| 365 |
* Gets a signed 32-bit integer contained within the attribute. If the |
|---|
| 366 |
* attribute does not contain a signed 32-bit integer, or is invalid, |
|---|
| 367 |
* 0 will be returned. |
|---|
| 368 |
* Params: |
|---|
| 369 |
* attribute = a file attribute key. |
|---|
| 370 |
* Returns: a signed 32-bit integer from the attribute. |
|---|
| 371 |
*/ |
|---|
| 372 |
public int getAttributeInt32(string attribute) |
|---|
| 373 |
{ |
|---|
| 374 |
// gint32 g_file_info_get_attribute_int32 (GFileInfo *info, const char *attribute); |
|---|
| 375 |
return g_file_info_get_attribute_int32(gFileInfo, Str.toStringz(attribute)); |
|---|
| 376 |
} |
|---|
| 377 |
|
|---|
| 378 |
/** |
|---|
| 379 |
* Gets a unsigned 64-bit integer contained within the attribute. If the |
|---|
| 380 |
* attribute does not contain an unsigned 64-bit integer, or is invalid, |
|---|
| 381 |
* 0 will be returned. |
|---|
| 382 |
* Params: |
|---|
| 383 |
* attribute = a file attribute key. |
|---|
| 384 |
* Returns: a unsigned 64-bit integer from the attribute. |
|---|
| 385 |
*/ |
|---|
| 386 |
public ulong getAttributeUint64(string attribute) |
|---|
| 387 |
{ |
|---|
| 388 |
// guint64 g_file_info_get_attribute_uint64 (GFileInfo *info, const char *attribute); |
|---|
| 389 |
return g_file_info_get_attribute_uint64(gFileInfo, Str.toStringz(attribute)); |
|---|
| 390 |
} |
|---|
| 391 |
|
|---|
| 392 |
/** |
|---|
| 393 |
* Gets a signed 64-bit integer contained within the attribute. If the |
|---|
| 394 |
* attribute does not contain an signed 64-bit integer, or is invalid, |
|---|
| 395 |
* 0 will be returned. |
|---|
| 396 |
* Params: |
|---|
| 397 |
* attribute = a file attribute key. |
|---|
| 398 |
* Returns: a signed 64-bit integer from the attribute. |
|---|
| 399 |
*/ |
|---|
| 400 |
public long getAttributeInt64(string attribute) |
|---|
| 401 |
{ |
|---|
| 402 |
// gint64 g_file_info_get_attribute_int64 (GFileInfo *info, const char *attribute); |
|---|
| 403 |
return g_file_info_get_attribute_int64(gFileInfo, Str.toStringz(attribute)); |
|---|
| 404 |
} |
|---|
| 405 |
|
|---|
| 406 |
/** |
|---|
| 407 |
* Gets the value of a GObject attribute. If the attribute does |
|---|
| 408 |
* not contain a GObject, NULL will be returned. |
|---|
| 409 |
* Params: |
|---|
| 410 |
* attribute = a file attribute key. |
|---|
| 411 |
* Returns: a GObject associated with the given attribute, or NULL otherwise. [transfer none] |
|---|
| 412 |
*/ |
|---|
| 413 |
public ObjectG getAttributeObject(string attribute) |
|---|
| 414 |
{ |
|---|
| 415 |
// GObject * g_file_info_get_attribute_object (GFileInfo *info, const char *attribute); |
|---|
| 416 |
auto p = g_file_info_get_attribute_object(gFileInfo, Str.toStringz(attribute)); |
|---|
| 417 |
if(p is null) |
|---|
| 418 |
{ |
|---|
| 419 |
return null; |
|---|
| 420 |
} |
|---|
| 421 |
return new ObjectG(cast(GObject*) p); |
|---|
| 422 |
} |
|---|
| 423 |
|
|---|
| 424 |
/** |
|---|
| 425 |
* Sets the attribute to contain the given value, if possible. |
|---|
| 426 |
* Params: |
|---|
| 427 |
* attribute = a file attribute key. |
|---|
| 428 |
* type = a GFileAttributeType |
|---|
| 429 |
* valueP = pointer to the value |
|---|
| 430 |
*/ |
|---|
| 431 |
public void setAttribute(string attribute, GFileAttributeType type, void* valueP) |
|---|
| 432 |
{ |
|---|
| 433 |
// void g_file_info_set_attribute (GFileInfo *info, const char *attribute, GFileAttributeType type, gpointer value_p); |
|---|
| 434 |
g_file_info_set_attribute(gFileInfo, Str.toStringz(attribute), type, valueP); |
|---|
| 435 |
} |
|---|
| 436 |
|
|---|
| 437 |
/** |
|---|
| 438 |
* Sets the attribute status for an attribute key. This is only |
|---|
| 439 |
* needed by external code that implement g_file_set_attributes_from_info() |
|---|
| 440 |
* or similar functions. |
|---|
| 441 |
* The attribute must exist in info for this to work. Otherwise FALSE |
|---|
| 442 |
* is returned and info is unchanged. |
|---|
| 443 |
* Since 2.22 |
|---|
| 444 |
* Params: |
|---|
| 445 |
* attribute = a file attribute key |
|---|
| 446 |
* status = a GFileAttributeStatus |
|---|
| 447 |
* Returns: TRUE if the status was changed, FALSE if the key was not set. |
|---|
| 448 |
*/ |
|---|
| 449 |
public int setAttributeStatus(string attribute, GFileAttributeStatus status) |
|---|
| 450 |
{ |
|---|
| 451 |
// gboolean g_file_info_set_attribute_status (GFileInfo *info, const char *attribute, GFileAttributeStatus status); |
|---|
| 452 |
return g_file_info_set_attribute_status(gFileInfo, Str.toStringz(attribute), status); |
|---|
| 453 |
} |
|---|
| 454 |
|
|---|
| 455 |
/** |
|---|
| 456 |
* Sets the attribute to contain the given attr_value, |
|---|
| 457 |
* if possible. |
|---|
| 458 |
* Params: |
|---|
| 459 |
* attribute = a file attribute key. |
|---|
| 460 |
* attrValue = a string. |
|---|
| 461 |
*/ |
|---|
| 462 |
public void setAttributeString(string attribute, string attrValue) |
|---|
| 463 |
{ |
|---|
| 464 |
// void g_file_info_set_attribute_string (GFileInfo *info, const char *attribute, const char *attr_value); |
|---|
| 465 |
g_file_info_set_attribute_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue)); |
|---|
| 466 |
} |
|---|
| 467 |
|
|---|
| 468 |
/** |
|---|
| 469 |
* Sets the attribute to contain the given attr_value, |
|---|
| 470 |
* if possible. |
|---|
| 471 |
* Sinze: 2.22 |
|---|
| 472 |
* Params: |
|---|
| 473 |
* attribute = a file attribute key. |
|---|
| 474 |
* attrValue = a NULL terminated string array |
|---|
| 475 |
*/ |
|---|
| 476 |
public void setAttributeStringv(string attribute, string[] attrValue) |
|---|
| 477 |
{ |
|---|
| 478 |
// void g_file_info_set_attribute_stringv (GFileInfo *info, const char *attribute, char **attr_value); |
|---|
| 479 |
g_file_info_set_attribute_stringv(gFileInfo, Str.toStringz(attribute), Str.toStringzArray(attrValue)); |
|---|
| 480 |
} |
|---|
| 481 |
|
|---|
| 482 |
/** |
|---|
| 483 |
* Sets the attribute to contain the given attr_value, |
|---|
| 484 |
* if possible. |
|---|
| 485 |
* Params: |
|---|
| 486 |
* attribute = a file attribute key. |
|---|
| 487 |
* attrValue = a byte string. |
|---|
| 488 |
*/ |
|---|
| 489 |
public void setAttributeByteString(string attribute, string attrValue) |
|---|
| 490 |
{ |
|---|
| 491 |
// void g_file_info_set_attribute_byte_string (GFileInfo *info, const char *attribute, const char *attr_value); |
|---|
| 492 |
g_file_info_set_attribute_byte_string(gFileInfo, Str.toStringz(attribute), Str.toStringz(attrValue)); |
|---|
| 493 |
} |
|---|
| 494 |
|
|---|
| 495 |
/** |
|---|
| 496 |
* Sets the attribute to contain the given attr_value, |
|---|
| 497 |
* if possible. |
|---|
| 498 |
* Params: |
|---|
| 499 |
* attribute = a file attribute key. |
|---|
| 500 |
* attrValue = a boolean value. |
|---|
| 501 |
*/ |
|---|
| 502 |
public void setAttributeBoolean(string attribute, int attrValue) |
|---|
| 503 |
{ |
|---|
| 504 |
// void g_file_info_set_attribute_boolean (GFileInfo *info, const char *attribute, gboolean attr_value); |
|---|
| 505 |
g_file_info_set_attribute_boolean(gFileInfo, Str.toStringz(attribute), attrValue); |
|---|
| 506 |
} |
|---|
| 507 |
|
|---|
| 508 |
/** |
|---|
| 509 |
* Sets the attribute to contain the given attr_value, |
|---|
| 510 |
* if possible. |
|---|
| 511 |
* Params: |
|---|
| 512 |
* attribute = a file attribute key. |
|---|
| 513 |
* attrValue = an unsigned 32-bit integer. |
|---|
| 514 |
*/ |
|---|
| 515 |
public void setAttributeUint32(string attribute, uint attrValue) |
|---|
| 516 |
{ |
|---|
| 517 |
// void g_file_info_set_attribute_uint32 (GFileInfo *info, const char *attribute, guint32 attr_value); |
|---|
| 518 |
g_file_info_set_attribute_uint32(gFileInfo, Str.toStringz(attribute), attrValue); |
|---|
| 519 |
} |
|---|
| 520 |
|
|---|
| 521 |
/** |
|---|
| 522 |
* Sets the attribute to contain the given attr_value, |
|---|
| 523 |
* if possible. |
|---|
| 524 |
* Params: |
|---|
| 525 |
* attribute = a file attribute key. |
|---|
| 526 |
* attrValue = a signed 32-bit integer |
|---|
| 527 |
*/ |
|---|
| 528 |
public void setAttributeInt32(string attribute, int attrValue) |
|---|
| 529 |
{ |
|---|
| 530 |
// void g_file_info_set_attribute_int32 (GFileInfo *info, const char *attribute, gint32 attr_value); |
|---|
| 531 |
g_file_info_set_attribute_int32(gFileInfo, Str.toStringz(attribute), attrValue); |
|---|
| 532 |
} |
|---|
| 533 |
|
|---|
| 534 |
/** |
|---|
| 535 |
* Sets the attribute to contain the given attr_value, |
|---|
| 536 |
* if possible. |
|---|
| 537 |
* Params: |
|---|
| 538 |
* attribute = a file attribute key. |
|---|
| 539 |
* attrValue = an unsigned 64-bit integer. |
|---|
| 540 |
*/ |
|---|
| 541 |
public void setAttributeUint64(string attribute, ulong attrValue) |
|---|
| 542 |
{ |
|---|
| 543 |
// void g_file_info_set_attribute_uint64 (GFileInfo *info, const char *attribute, guint64 attr_value); |
|---|
| 544 |
g_file_info_set_attribute_uint64(gFileInfo, Str.toStringz(attribute), attrValue); |
|---|
| 545 |
} |
|---|
| 546 |
|
|---|
| 547 |
/** |
|---|
| 548 |
* Sets the attribute to contain the given attr_value, |
|---|
| 549 |
* if possible. |
|---|
| 550 |
* Params: |
|---|
| 551 |
* attribute = attribute name to set. |
|---|
| 552 |
* attrValue = int64 value to set attribute to. |
|---|
| 553 |
*/ |
|---|
| 554 |
public void setAttributeInt64(string attribute, long attrValue) |
|---|
| 555 |
{ |
|---|
| 556 |
// void g_file_info_set_attribute_int64 (GFileInfo *info, const char *attribute, gint64 attr_value); |
|---|
| 557 |
g_file_info_set_attribute_int64(gFileInfo, Str.toStringz(attribute), attrValue); |
|---|
| 558 |
} |
|---|
| 559 |
|
|---|
| 560 |
/** |
|---|
| 561 |
* Sets the attribute to contain the given attr_value, |
|---|
| 562 |
* if possible. |
|---|
| 563 |
* Params: |
|---|
| 564 |
* attribute = a file attribute key. |
|---|
| 565 |
* attrValue = a GObject. |
|---|
| 566 |
*/ |
|---|
| 567 |
public void setAttributeObject(string attribute, ObjectG attrValue) |
|---|
| 568 |
{ |
|---|
| 569 |
// void g_file_info_set_attribute_object (GFileInfo *info, const char *attribute, GObject *attr_value); |
|---|
| 570 |
g_file_info_set_attribute_object(gFileInfo, Str.toStringz(attribute), (attrValue is null) ? null : attrValue.getObjectGStruct()); |
|---|
| 571 |
} |
|---|
| 572 |
|
|---|
| 573 |
/** |
|---|
| 574 |
* Clears the status information from info. |
|---|
| 575 |
*/ |
|---|
| 576 |
public void clearStatus() |
|---|
| 577 |
{ |
|---|
| 578 |
// void g_file_info_clear_status (GFileInfo *info); |
|---|
| 579 |
g_file_info_clear_status(gFileInfo); |
|---|
| 580 |
} |
|---|
| 581 |
|
|---|
| 582 |
/** |
|---|
| 583 |
* Gets a file's type (whether it is a regular file, symlink, etc). |
|---|
| 584 |
* This is different from the file's content type, see g_file_info_get_content_type(). |
|---|
| 585 |
* Returns: a GFileType for the given file. |
|---|
| 586 |
*/ |
|---|
| 587 |
public GFileType getFileType() |
|---|
| 588 |
{ |
|---|
| 589 |
// GFileType g_file_info_get_file_type (GFileInfo *info); |
|---|
| 590 |
return g_file_info_get_file_type(gFileInfo); |
|---|
| 591 |
} |
|---|
| 592 |
|
|---|
| 593 |
/** |
|---|
| 594 |
* Checks if a file is hidden. |
|---|
| 595 |
* Returns: TRUE if the file is a hidden file, FALSE otherwise. |
|---|
| 596 |
*/ |
|---|
| 597 |
public int getIsHidden() |
|---|
| 598 |
{ |
|---|
| 599 |
// gboolean g_file_info_get_is_hidden (GFileInfo *info); |
|---|
| 600 |
return g_file_info_get_is_hidden(gFileInfo); |
|---|
| 601 |
} |
|---|
| 602 |
|
|---|
| 603 |
/** |
|---|
| 604 |
* Checks if a file is a backup file. |
|---|
| 605 |
* Returns: TRUE if file is a backup file, FALSE otherwise. |
|---|
| 606 |
*/ |
|---|
| 607 |
public int getIsBackup() |
|---|
| 608 |
{ |
|---|
| 609 |
// gboolean g_file_info_get_is_backup (GFileInfo *info); |
|---|
| 610 |
return g_file_info_get_is_backup(gFileInfo); |
|---|
| 611 |
} |
|---|
| 612 |
|
|---|
| 613 |
/** |
|---|
| 614 |
* Checks if a file is a symlink. |
|---|
| 615 |
* Returns: TRUE if the given info is a symlink. |
|---|
| 616 |
*/ |
|---|
| 617 |
public int getIsSymlink() |
|---|
| 618 |
{ |
|---|
| 619 |
// gboolean g_file_info_get_is_symlink (GFileInfo *info); |
|---|
| 620 |
return g_file_info_get_is_symlink(gFileInfo); |
|---|
| 621 |
} |
|---|
| 622 |
|
|---|
| 623 |
/** |
|---|
| 624 |
* Gets the name for a file. |
|---|
| 625 |
* Returns: a string containing the file name. |
|---|
| 626 |
*/ |
|---|
| 627 |
public string getName() |
|---|
| 628 |
{ |
|---|
| 629 |
// const char * g_file_info_get_name (GFileInfo *info); |
|---|
| 630 |
return Str.toString(g_file_info_get_name(gFileInfo)); |
|---|
| 631 |
} |
|---|
| 632 |
|
|---|
| 633 |
/** |
|---|
| 634 |
* Gets a display name for a file. |
|---|
| 635 |
* Returns: a string containing the display name. |
|---|
| 636 |
*/ |
|---|
| 637 |
public string getDisplayName() |
|---|
| 638 |
{ |
|---|
| 639 |
// const char * g_file_info_get_display_name (GFileInfo *info); |
|---|
| 640 |
return Str.toString(g_file_info_get_display_name(gFileInfo)); |
|---|
| 641 |
} |
|---|
| 642 |
|
|---|
| 643 |
/** |
|---|
| 644 |
* Gets the edit name for a file. |
|---|
| 645 |
* Returns: a string containing the edit name. |
|---|
| 646 |
*/ |
|---|
| 647 |
public string getEditName() |
|---|
| 648 |
{ |
|---|
| 649 |
// const char * g_file_info_get_edit_name (GFileInfo *info); |
|---|
| 650 |
return Str.toString(g_file_info_get_edit_name(gFileInfo)); |
|---|
| 651 |
} |
|---|
| 652 |
|
|---|
| 653 |
/** |
|---|
| 654 |
* Gets the icon for a file. |
|---|
| 655 |
* Returns: GIcon for the given info. [transfer none] |
|---|
| 656 |
*/ |
|---|
| 657 |
public IconIF getIcon() |
|---|
| 658 |
{ |
|---|
| 659 |
// GIcon * g_file_info_get_icon (GFileInfo *info); |
|---|
| 660 |
auto p = g_file_info_get_icon(gFileInfo); |
|---|
| 661 |
if(p is null) |
|---|
| 662 |
{ |
|---|
| 663 |
return null; |
|---|
| 664 |
} |
|---|
| 665 |
return new Icon(cast(GIcon*) p); |
|---|
| 666 |
} |
|---|
| 667 |
|
|---|
| 668 |
/** |
|---|
| 669 |
* Gets the file's content type. |
|---|
| 670 |
* Returns: a string containing the file's content type. |
|---|
| 671 |
*/ |
|---|
| 672 |
public string getContentType() |
|---|
| 673 |
{ |
|---|
| 674 |
// const char * g_file_info_get_content_type (GFileInfo *info); |
|---|
| 675 |
return Str.toString(g_file_info_get_content_type(gFileInfo)); |
|---|
| 676 |
} |
|---|
| 677 |
|
|---|
| 678 |
/** |
|---|
| 679 |
* Gets the file's size. |
|---|
| 680 |
* Returns: a goffset containing the file's size. |
|---|
| 681 |
*/ |
|---|
| 682 |
public long getSize() |
|---|
| 683 |
{ |
|---|
| 684 |
// goffset g_file_info_get_size (GFileInfo *info); |
|---|
| 685 |
return g_file_info_get_size(gFileInfo); |
|---|
| 686 |
} |
|---|
| 687 |
|
|---|
| 688 |
/** |
|---|
| 689 |
* Gets the modification time of the current info and sets it |
|---|
| 690 |
* in result. |
|---|
| 691 |
* Params: |
|---|
| 692 |
* result = a GTimeVal. |
|---|
| 693 |
*/ |
|---|
| 694 |
public void getModificationTime(TimeVal result) |
|---|
| 695 |
{ |
|---|
| 696 |
// void g_file_info_get_modification_time (GFileInfo *info, GTimeVal *result); |
|---|
| 697 |
g_file_info_get_modification_time(gFileInfo, (result is null) ? null : result.getTimeValStruct()); |
|---|
| 698 |
} |
|---|
| 699 |
|
|---|
| 700 |
/** |
|---|
| 701 |
* Gets the symlink target for a given GFileInfo. |
|---|
| 702 |
* Returns: a string containing the symlink target. |
|---|
| 703 |
*/ |
|---|
| 704 |
public string getSymlinkTarget() |
|---|
| 705 |
{ |
|---|
| 706 |
// const char * g_file_info_get_symlink_target (GFileInfo *info); |
|---|
| 707 |
return Str.toString(g_file_info_get_symlink_target(gFileInfo)); |
|---|
| 708 |
} |
|---|
| 709 |
|
|---|
| 710 |
/** |
|---|
| 711 |
* Gets the entity tag for a given |
|---|
| 712 |
* GFileInfo. See G_FILE_ATTRIBUTE_ETAG_VALUE. |
|---|
| 713 |
* Returns: a string containing the value of the "etag:value" attribute. |
|---|
| 714 |
*/ |
|---|
| 715 |
public string getEtag() |
|---|
| 716 |
{ |
|---|
| 717 |
// const char * g_file_info_get_etag (GFileInfo *info); |
|---|
| 718 |
return Str.toString(g_file_info_get_etag(gFileInfo)); |
|---|
| 719 |
} |
|---|
| 720 |
|
|---|
| 721 |
/** |
|---|
| 722 |
* Gets the value of the sort_order attribute from the GFileInfo. |
|---|
| 723 |
* See G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. |
|---|
| 724 |
* Returns: a gint32 containing the value of the "standard::sort_order" attribute. |
|---|
| 725 |
*/ |
|---|
| 726 |
public int getSortOrder() |
|---|
| 727 |
{ |
|---|
| 728 |
// gint32 g_file_info_get_sort_order (GFileInfo *info); |
|---|
| 729 |
return g_file_info_get_sort_order(gFileInfo); |
|---|
| 730 |
} |
|---|
| 731 |
|
|---|
| 732 |
/** |
|---|
| 733 |
* Sets mask on info to match specific attribute types. |
|---|
| 734 |
* Params: |
|---|
| 735 |
* mask = a GFileAttributeMatcher. |
|---|
| 736 |
*/ |
|---|
| 737 |
public void setAttributeMask(FileAttributeMatcher mask) |
|---|
| 738 |
{ |
|---|
| 739 |
// void g_file_info_set_attribute_mask (GFileInfo *info, GFileAttributeMatcher *mask); |
|---|
| 740 |
g_file_info_set_attribute_mask(gFileInfo, (mask is null) ? null : mask.getFileAttributeMatcherStruct()); |
|---|
| 741 |
} |
|---|
| 742 |
|
|---|
| 743 |
/** |
|---|
| 744 |
* Unsets a mask set by g_file_info_set_attribute_mask(), if one |
|---|
| 745 |
* is set. |
|---|
| 746 |
*/ |
|---|
| 747 |
public void unsetAttributeMask() |
|---|
| 748 |
{ |
|---|
| 749 |
// void g_file_info_unset_attribute_mask (GFileInfo *info); |
|---|
| 750 |
g_file_info_unset_attribute_mask(gFileInfo); |
|---|
| 751 |
} |
|---|
| 752 |
|
|---|
| 753 |
/** |
|---|
| 754 |
* Sets the file type in a GFileInfo to type. |
|---|
| 755 |
* See G_FILE_ATTRIBUTE_STANDARD_TYPE. |
|---|
| 756 |
* Params: |
|---|
| 757 |
* type = a GFileType. |
|---|
| 758 |
*/ |
|---|
| 759 |
public void setFileType(GFileType type) |
|---|
| 760 |
{ |
|---|
| 761 |
// void g_file_info_set_file_type (GFileInfo *info, GFileType type); |
|---|
| 762 |
g_file_info_set_file_type(gFileInfo, type); |
|---|
| 763 |
} |
|---|
| 764 |
|
|---|
| 765 |
/** |
|---|
| 766 |
* Sets the "is_hidden" attribute in a GFileInfo according to is_symlink. |
|---|
| 767 |
* See G_FILE_ATTRIBUTE_STANDARD_IS_HIDDEN. |
|---|
| 768 |
* Params: |
|---|
| 769 |
* isHidden = a gboolean. |
|---|
| 770 |
*/ |
|---|
| 771 |
public void setIsHidden(int isHidden) |
|---|
| 772 |
{ |
|---|
| 773 |
// void g_file_info_set_is_hidden (GFileInfo *info, gboolean is_hidden); |
|---|
| 774 |
g_file_info_set_is_hidden(gFileInfo, isHidden); |
|---|
| 775 |
} |
|---|
| 776 |
|
|---|
| 777 |
/** |
|---|
| 778 |
* Sets the "is_symlink" attribute in a GFileInfo according to is_symlink. |
|---|
| 779 |
* See G_FILE_ATTRIBUTE_STANDARD_IS_SYMLINK. |
|---|
| 780 |
* Params: |
|---|
| 781 |
* isSymlink = a gboolean. |
|---|
| 782 |
*/ |
|---|
| 783 |
public void setIsSymlink(int isSymlink) |
|---|
| 784 |
{ |
|---|
| 785 |
// void g_file_info_set_is_symlink (GFileInfo *info, gboolean is_symlink); |
|---|
| 786 |
g_file_info_set_is_symlink(gFileInfo, isSymlink); |
|---|
| 787 |
} |
|---|
| 788 |
|
|---|
| 789 |
/** |
|---|
| 790 |
* Sets the name attribute for the current GFileInfo. |
|---|
| 791 |
* See G_FILE_ATTRIBUTE_STANDARD_NAME. |
|---|
| 792 |
* Params: |
|---|
| 793 |
* name = a string containing a name. |
|---|
| 794 |
*/ |
|---|
| 795 |
public void setName(string name) |
|---|
| 796 |
{ |
|---|
| 797 |
// void g_file_info_set_name (GFileInfo *info, const char *name); |
|---|
| 798 |
g_file_info_set_name(gFileInfo, Str.toStringz(name)); |
|---|
| 799 |
} |
|---|
| 800 |
|
|---|
| 801 |
/** |
|---|
| 802 |
* Sets the display name for the current GFileInfo. |
|---|
| 803 |
* See G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME. |
|---|
| 804 |
* Params: |
|---|
| 805 |
* displayName = a string containing a display name. |
|---|
| 806 |
*/ |
|---|
| 807 |
public void setDisplayName(string displayName) |
|---|
| 808 |
{ |
|---|
| 809 |
// void g_file_info_set_display_name (GFileInfo *info, const char *display_name); |
|---|
| 810 |
g_file_info_set_display_name(gFileInfo, Str.toStringz(displayName)); |
|---|
| 811 |
} |
|---|
| 812 |
|
|---|
| 813 |
/** |
|---|
| 814 |
* Sets the edit name for the current file. |
|---|
| 815 |
* See G_FILE_ATTRIBUTE_STANDARD_EDIT_NAME. |
|---|
| 816 |
* Params: |
|---|
| 817 |
* editName = a string containing an edit name. |
|---|
| 818 |
*/ |
|---|
| 819 |
public void setEditName(string editName) |
|---|
| 820 |
{ |
|---|
| 821 |
// void g_file_info_set_edit_name (GFileInfo *info, const char *edit_name); |
|---|
| 822 |
g_file_info_set_edit_name(gFileInfo, Str.toStringz(editName)); |
|---|
| 823 |
} |
|---|
| 824 |
|
|---|
| 825 |
/** |
|---|
| 826 |
* Sets the icon for a given GFileInfo. |
|---|
| 827 |
* See G_FILE_ATTRIBUTE_STANDARD_ICON. |
|---|
| 828 |
* Params: |
|---|
| 829 |
* icon = a GIcon. |
|---|
| 830 |
*/ |
|---|
| 831 |
public void setIcon(IconIF icon) |
|---|
| 832 |
{ |
|---|
| 833 |
// void g_file_info_set_icon (GFileInfo *info, GIcon *icon); |
|---|
| 834 |
g_file_info_set_icon(gFileInfo, (icon is null) ? null : icon.getIconTStruct()); |
|---|
| 835 |
} |
|---|
| 836 |
|
|---|
| 837 |
/** |
|---|
| 838 |
* Sets the content type attribute for a given GFileInfo. |
|---|
| 839 |
* See G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE. |
|---|
| 840 |
* Params: |
|---|
| 841 |
* contentType = a content type. See GContentType. |
|---|
| 842 |
*/ |
|---|
| 843 |
public void setContentType(string contentType) |
|---|
| 844 |
{ |
|---|
| 845 |
// void g_file_info_set_content_type (GFileInfo *info, const char *content_type); |
|---|
| 846 |
g_file_info_set_content_type(gFileInfo, Str.toStringz(contentType)); |
|---|
| 847 |
} |
|---|
| 848 |
|
|---|
| 849 |
/** |
|---|
| 850 |
* Sets the G_FILE_ATTRIBUTE_STANDARD_SIZE attribute in the file info |
|---|
| 851 |
* to the given size. |
|---|
| 852 |
* Params: |
|---|
| 853 |
* size = a goffset containing the file's size. |
|---|
| 854 |
*/ |
|---|
| 855 |
public void setSize(long size) |
|---|
| 856 |
{ |
|---|
| 857 |
// void g_file_info_set_size (GFileInfo *info, goffset size); |
|---|
| 858 |
g_file_info_set_size(gFileInfo, size); |
|---|
| 859 |
} |
|---|
| 860 |
|
|---|
| 861 |
/** |
|---|
| 862 |
* Sets the G_FILE_ATTRIBUTE_TIME_MODIFIED attribute in the file |
|---|
| 863 |
* info to the given time value. |
|---|
| 864 |
* Params: |
|---|
| 865 |
* mtime = a GTimeVal. |
|---|
| 866 |
*/ |
|---|
| 867 |
public void setModificationTime(TimeVal mtime) |
|---|
| 868 |
{ |
|---|
| 869 |
// void g_file_info_set_modification_time (GFileInfo *info, GTimeVal *mtime); |
|---|
| 870 |
g_file_info_set_modification_time(gFileInfo, (mtime is null) ? null : mtime.getTimeValStruct()); |
|---|
| 871 |
} |
|---|
| 872 |
|
|---|
| 873 |
/** |
|---|
| 874 |
* Sets the G_FILE_ATTRIBUTE_STANDARD_SYMLINK_TARGET attribute in the file info |
|---|
| 875 |
* to the given symlink target. |
|---|
| 876 |
* Params: |
|---|
| 877 |
* symlinkTarget = a static string containing a path to a symlink target. |
|---|
| 878 |
*/ |
|---|
| 879 |
public void setSymlinkTarget(string symlinkTarget) |
|---|
| 880 |
{ |
|---|
| 881 |
// void g_file_info_set_symlink_target (GFileInfo *info, const char *symlink_target); |
|---|
| 882 |
g_file_info_set_symlink_target(gFileInfo, Str.toStringz(symlinkTarget)); |
|---|
| 883 |
} |
|---|
| 884 |
|
|---|
| 885 |
/** |
|---|
| 886 |
* Sets the sort order attribute in the file info structure. See |
|---|
| 887 |
* G_FILE_ATTRIBUTE_STANDARD_SORT_ORDER. |
|---|
| 888 |
* Params: |
|---|
| 889 |
* sortOrder = a sort order integer. |
|---|
| 890 |
*/ |
|---|
| 891 |
public void setSortOrder(int sortOrder) |
|---|
| 892 |
{ |
|---|
| 893 |
// void g_file_info_set_sort_order (GFileInfo *info, gint32 sort_order); |
|---|
| 894 |
g_file_info_set_sort_order(gFileInfo, sortOrder); |
|---|
| 895 |
} |
|---|
| 896 |
} |
|---|