My Project
UDK 3.2.7 C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
file.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef _OSL_FILE_H_
21 #define _OSL_FILE_H_
22 
23 #include "sal/config.h"
24 
25 #include "osl/time.h"
26 #include "rtl/ustring.h"
27 #include "sal/saldllapi.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
84 /* Error codes according to errno */
85 
86 typedef enum {
132  osl_File_E_invalidError, /* unmapped error: always last entry in enum! */
136 } oslFileError;
137 
138 typedef void *oslDirectory;
139 typedef void *oslDirectoryItem;
140 
141 
168  rtl_uString *pustrDirectoryURL, oslDirectory *pDirectory);
169 
170 
203  oslDirectory Directory,
204  oslDirectoryItem *pItem,
205  sal_uInt32 uHint
206  );
207 
208 
225  oslDirectory Directory);
226 
227 
265  rtl_uString *pustrFileURL,
266  oslDirectoryItem *pItem
267  );
268 
269 
288  oslDirectoryItem Item );
289 
290 
311  oslDirectoryItem Item );
312 
334  oslDirectoryItem pItemA,
335  oslDirectoryItem pItemB );
336 
337 /* File types */
338 
339 typedef enum {
348 } oslFileType;
349 
350 /* File attributes */
351 #define osl_File_Attribute_ReadOnly 0x00000001
352 #define osl_File_Attribute_Hidden 0x00000002
353 #define osl_File_Attribute_Executable 0x00000010
354 #define osl_File_Attribute_GrpWrite 0x00000020
355 #define osl_File_Attribute_GrpRead 0x00000040
356 #define osl_File_Attribute_GrpExe 0x00000080
357 #define osl_File_Attribute_OwnWrite 0x00000100
358 #define osl_File_Attribute_OwnRead 0x00000200
359 #define osl_File_Attribute_OwnExe 0x00000400
360 #define osl_File_Attribute_OthWrite 0x00000800
361 #define osl_File_Attribute_OthRead 0x00001000
362 #define osl_File_Attribute_OthExe 0x00002000
363 
364 /* Flags specifying which fields to retreive by osl_getFileStatus */
365 
366 #define osl_FileStatus_Mask_Type 0x00000001
367 #define osl_FileStatus_Mask_Attributes 0x00000002
368 #define osl_FileStatus_Mask_CreationTime 0x00000010
369 #define osl_FileStatus_Mask_AccessTime 0x00000020
370 #define osl_FileStatus_Mask_ModifyTime 0x00000040
371 #define osl_FileStatus_Mask_FileSize 0x00000080
372 #define osl_FileStatus_Mask_FileName 0x00000100
373 #define osl_FileStatus_Mask_FileURL 0x00000200
374 #define osl_FileStatus_Mask_LinkTargetURL 0x00000400
375 #define osl_FileStatus_Mask_All 0x7FFFFFFF
376 #define osl_FileStatus_Mask_Validate 0x80000000
377 
378 
379 typedef
380 
389  sal_uInt32 uStructSize;
391  sal_uInt32 uValidFields;
395  sal_uInt64 uAttributes;
405  sal_uInt64 uFileSize;
408  rtl_uString *ustrFileName;
411  rtl_uString *ustrFileURL;
415  rtl_uString *ustrLinkTargetURL;
416 } oslFileStatus;
417 
418 
459  oslDirectoryItem Item, oslFileStatus *pStatus, sal_uInt32 uFieldMask );
460 
461 
462 typedef void *oslVolumeDeviceHandle;
463 
483  oslVolumeDeviceHandle Handle );
484 
504  oslVolumeDeviceHandle Handle );
505 
506 
534  oslVolumeDeviceHandle Handle, rtl_uString **ppustrDirectoryURL);
535 
536 /* Volume attributes */
537 
538 #define osl_Volume_Attribute_Removeable 0x00000001L
539 #define osl_Volume_Attribute_Remote 0x00000002L
540 #define osl_Volume_Attribute_CompactDisc 0x00000004L
541 #define osl_Volume_Attribute_FixedDisk 0x00000008L
542 #define osl_Volume_Attribute_RAMDisk 0x00000010L
543 #define osl_Volume_Attribute_FloppyDisk 0x00000020L
544 
545 #define osl_Volume_Attribute_Case_Is_Preserved 0x00000040L
546 #define osl_Volume_Attribute_Case_Sensitive 0x00000080L
547 
548 /* Flags specifying which fields to retreive by osl_getVolumeInfo */
549 
550 #define osl_VolumeInfo_Mask_Attributes 0x00000001L
551 #define osl_VolumeInfo_Mask_TotalSpace 0x00000002L
552 #define osl_VolumeInfo_Mask_UsedSpace 0x00000004L
553 #define osl_VolumeInfo_Mask_FreeSpace 0x00000008L
554 #define osl_VolumeInfo_Mask_MaxNameLength 0x00000010L
555 #define osl_VolumeInfo_Mask_MaxPathLength 0x00000020L
556 #define osl_VolumeInfo_Mask_FileSystemName 0x00000040L
557 #define osl_VolumeInfo_Mask_DeviceHandle 0x00000080L
558 #define osl_VolumeInfo_Mask_FileSystemCaseHandling 0x00000100L
559 
560 typedef
561 
570  sal_uInt32 uStructSize;
572  sal_uInt32 uValidFields;
574  sal_uInt32 uAttributes;
576  sal_uInt64 uTotalSpace;
578  sal_uInt64 uUsedSpace;
580  sal_uInt64 uFreeSpace;
582  sal_uInt32 uMaxNameLength;
584  sal_uInt32 uMaxPathLength;
587  rtl_uString *ustrFileSystemName;
589  oslVolumeDeviceHandle *pDeviceHandle;
590 } oslVolumeInfo;
591 
592 
630  rtl_uString *pustrDirectoryURL,
631  oslVolumeInfo *pInfo,
632  sal_uInt32 uFieldMask );
633 
634 typedef void *oslFileHandle;
635 
636 /* Open flags */
637 
638 #define osl_File_OpenFlag_Read 0x00000001L
639 #define osl_File_OpenFlag_Write 0x00000002L
640 #define osl_File_OpenFlag_Create 0x00000004L
641 #define osl_File_OpenFlag_NoLock 0x00000008L
642 /* larger bit-fields reserved for internal use cf. detail/file.h */
643 
700  rtl_uString *pustrFileURL, oslFileHandle *pHandle, sal_uInt32 uFlags );
701 
702 #define osl_Pos_Absolut 1
703 #define osl_Pos_Current 2
704 #define osl_Pos_End 3
705 
727  oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uPos ) SAL_WARN_UNUSED_RESULT;
728 
729 
750  oslFileHandle Handle, sal_uInt64 *pPos );
751 
752 
776  oslFileHandle Handle, sal_uInt64 uSize );
777 
778 
801  oslFileHandle Handle, sal_uInt64 *pSize );
802 
803 
808 #define osl_File_MapFlag_RandomAccess ((sal_uInt32)(0x1))
809 
816 #define osl_File_MapFlag_WillNeed ((sal_uInt32)(0x2))
817 
832  oslFileHandle Handle,
833  void** ppAddr,
834  sal_uInt64 uLength,
835  sal_uInt64 uOffset,
836  sal_uInt32 uFlags
837 );
838 
839 
840 #ifndef ANDROID
841 
856  void* pAddr,
857  sal_uInt64 uLength
858 );
859 
860 #endif
861 
874  oslFileHandle Handle,
875  void* pAddr,
876  sal_uInt64 uLength
877 );
878 
879 
916  oslFileHandle Handle, void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64 *pBytesRead );
917 
918 
945  oslFileHandle Handle, sal_Bool *pIsEOF );
946 
947 
986  oslFileHandle Handle, const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64 *pBytesWritten );
987 
995  oslFileHandle Handle,
996  sal_uInt64 uOffset,
997  void* pBuffer,
998  sal_uInt64 uBytesRequested,
999  sal_uInt64* pBytesRead
1000 );
1001 
1002 
1010  oslFileHandle Handle,
1011  sal_uInt64 uOffset,
1012  const void* pBuffer,
1013  sal_uInt64 uBytesToWrite,
1014  sal_uInt64* pBytesWritten
1015 );
1016 
1017 
1046  oslFileHandle Handle, sal_Sequence** ppSequence );
1047 
1082 SAL_DLLPUBLIC oslFileError SAL_CALL osl_syncFile( oslFileHandle Handle );
1083 
1101 SAL_DLLPUBLIC oslFileError SAL_CALL osl_closeFile( oslFileHandle Handle );
1102 
1103 
1131 SAL_DLLPUBLIC oslFileError SAL_CALL osl_createDirectory( rtl_uString* pustrDirectoryURL );
1132 
1133 
1162 SAL_DLLPUBLIC oslFileError SAL_CALL osl_removeDirectory( rtl_uString* pustrDirectoryURL );
1163 
1179 typedef void (SAL_CALL *oslDirectoryCreationCallbackFunc)(void* pData, rtl_uString* aDirectoryUrl);
1180 
1241  rtl_uString* aDirectoryUrl,
1242  oslDirectoryCreationCallbackFunc aDirectoryCreationCallbackFunc,
1243  void* pData);
1244 
1274  rtl_uString* pustrFileURL );
1275 
1276 
1304  rtl_uString* pustrSourceFileURL, rtl_uString *pustrDestFileURL );
1305 
1306 
1332  rtl_uString* pustrSourceFileURL, rtl_uString *pustrDestFileURL );
1333 
1334 
1357  rtl_uString *pustrRequestedURL, rtl_uString **ppustrValidURL);
1358 
1359 
1396  rtl_uString* pustrBaseDirectoryURL,
1397  rtl_uString *pustrRelativeFileURL,
1398  rtl_uString **ppustrAbsoluteFileURL );
1399 
1400 
1417  rtl_uString *pustrSystemPath, rtl_uString **ppustrFileURL);
1418 
1419 
1449  rtl_uString *pustrFileName, rtl_uString *pustrSearchPath, rtl_uString **ppustrFileURL );
1450 
1451 
1468  rtl_uString *pustrFileURL, rtl_uString **ppustrSystemPath);
1469 
1470 
1483 typedef sal_uInt32 (SAL_CALL *oslCalcTextWidthFunc)( rtl_uString *ustrText );
1484 
1485 
1508  rtl_uString *ustrSystemPath,
1509  rtl_uString **pustrCompacted,
1510  sal_uInt32 uMaxWidth,
1511  oslCalcTextWidthFunc pCalcWidth );
1512 
1513 
1530  rtl_uString *pustrFileURL, sal_uInt64 uAttributes );
1531 
1532 
1556  rtl_uString *pustrFileURL,
1557  const TimeValue *aCreationTime,
1558  const TimeValue *aLastAccessTime,
1559  const TimeValue *aLastWriteTime);
1560 
1561 
1573  rtl_uString **pustrTempDirURL );
1574 
1575 
1628  rtl_uString* pustrDirectoryURL,
1629  oslFileHandle* pHandle,
1630  rtl_uString** ppustrTempFileURL);
1631 
1632 #ifdef __cplusplus
1633 }
1634 #endif
1635 
1636 #endif /* _OSL_FILE_H_ */
1637 
1638 
1639 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */