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  *
4  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5  *
6  * Copyright 2000, 2010 Oracle and/or its affiliates.
7  *
8  * OpenOffice.org - a multi-platform office productivity suite
9  *
10  * This file is part of OpenOffice.org.
11  *
12  * OpenOffice.org is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU Lesser General Public License version 3
14  * only, as published by the Free Software Foundation.
15  *
16  * OpenOffice.org is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU Lesser General Public License version 3 for more details
20  * (a copy is included in the LICENSE file that accompanied this code).
21  *
22  * You should have received a copy of the GNU Lesser General Public License
23  * version 3 along with OpenOffice.org. If not, see
24  * <http://www.openoffice.org/license.html>
25  * for a copy of the LGPLv3 License.
26  *
27  ************************************************************************/
28 
29 #ifndef _OSL_FILE_H_
30 #define _OSL_FILE_H_
31 
32 #include <osl/time.h>
33 # include <rtl/ustring.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
90 /* Error codes according to errno */
91 
92 typedef enum {
138  osl_File_E_invalidError, /* unmapped error: always last entry in enum! */
142 } oslFileError;
143 
144 typedef void *oslDirectory;
145 typedef void *oslDirectoryItem;
146 
147 
174  rtl_uString *pustrDirectoryURL, oslDirectory *pDirectory);
175 
176 
209  oslDirectory Directory,
210  oslDirectoryItem *pItem,
211  sal_uInt32 uHint
212  );
213 
214 
231  oslDirectory Directory);
232 
233 
271  rtl_uString *pustrFileURL,
272  oslDirectoryItem *pItem
273  );
274 
275 
294  oslDirectoryItem Item );
295 
296 
317  oslDirectoryItem Item );
318 
340  oslDirectoryItem pItemA,
341  oslDirectoryItem pItemB );
342 
343 /* File types */
344 
345 typedef enum {
354 } oslFileType;
355 
356 /* File attributes */
357 #define osl_File_Attribute_ReadOnly 0x00000001
358 #define osl_File_Attribute_Hidden 0x00000002
359 #define osl_File_Attribute_Executable 0x00000010
360 #define osl_File_Attribute_GrpWrite 0x00000020
361 #define osl_File_Attribute_GrpRead 0x00000040
362 #define osl_File_Attribute_GrpExe 0x00000080
363 #define osl_File_Attribute_OwnWrite 0x00000100
364 #define osl_File_Attribute_OwnRead 0x00000200
365 #define osl_File_Attribute_OwnExe 0x00000400
366 #define osl_File_Attribute_OthWrite 0x00000800
367 #define osl_File_Attribute_OthRead 0x00001000
368 #define osl_File_Attribute_OthExe 0x00002000
369 
370 /* Flags specifying which fields to retreive by osl_getFileStatus */
371 
372 #define osl_FileStatus_Mask_Type 0x00000001
373 #define osl_FileStatus_Mask_Attributes 0x00000002
374 #define osl_FileStatus_Mask_CreationTime 0x00000010
375 #define osl_FileStatus_Mask_AccessTime 0x00000020
376 #define osl_FileStatus_Mask_ModifyTime 0x00000040
377 #define osl_FileStatus_Mask_FileSize 0x00000080
378 #define osl_FileStatus_Mask_FileName 0x00000100
379 #define osl_FileStatus_Mask_FileURL 0x00000200
380 #define osl_FileStatus_Mask_LinkTargetURL 0x00000400
381 #define osl_FileStatus_Mask_All 0x7FFFFFFF
382 #define osl_FileStatus_Mask_Validate 0x80000000
383 
384 
385 typedef
386 
395  sal_uInt32 uStructSize;
397  sal_uInt32 uValidFields;
401  sal_uInt64 uAttributes;
411  sal_uInt64 uFileSize;
414  rtl_uString *ustrFileName;
417  rtl_uString *ustrFileURL;
421  rtl_uString *ustrLinkTargetURL;
422 } oslFileStatus;
423 
424 
465  oslDirectoryItem Item, oslFileStatus *pStatus, sal_uInt32 uFieldMask );
466 
467 
468 typedef void *oslVolumeDeviceHandle;
469 
489  oslVolumeDeviceHandle Handle );
490 
510  oslVolumeDeviceHandle Handle );
511 
512 
540  oslVolumeDeviceHandle Handle, rtl_uString **ppustrDirectoryURL);
541 
542 /* Volume attributes */
543 
544 #define osl_Volume_Attribute_Removeable 0x00000001L
545 #define osl_Volume_Attribute_Remote 0x00000002L
546 #define osl_Volume_Attribute_CompactDisc 0x00000004L
547 #define osl_Volume_Attribute_FixedDisk 0x00000008L
548 #define osl_Volume_Attribute_RAMDisk 0x00000010L
549 #define osl_Volume_Attribute_FloppyDisk 0x00000020L
550 
551 #define osl_Volume_Attribute_Case_Is_Preserved 0x00000040L
552 #define osl_Volume_Attribute_Case_Sensitive 0x00000080L
553 
554 /* Flags specifying which fields to retreive by osl_getVolumeInfo */
555 
556 #define osl_VolumeInfo_Mask_Attributes 0x00000001L
557 #define osl_VolumeInfo_Mask_TotalSpace 0x00000002L
558 #define osl_VolumeInfo_Mask_UsedSpace 0x00000004L
559 #define osl_VolumeInfo_Mask_FreeSpace 0x00000008L
560 #define osl_VolumeInfo_Mask_MaxNameLength 0x00000010L
561 #define osl_VolumeInfo_Mask_MaxPathLength 0x00000020L
562 #define osl_VolumeInfo_Mask_FileSystemName 0x00000040L
563 #define osl_VolumeInfo_Mask_DeviceHandle 0x00000080L
564 #define osl_VolumeInfo_Mask_FileSystemCaseHandling 0x00000100L
565 
566 typedef
567 
576  sal_uInt32 uStructSize;
578  sal_uInt32 uValidFields;
580  sal_uInt32 uAttributes;
582  sal_uInt64 uTotalSpace;
584  sal_uInt64 uUsedSpace;
586  sal_uInt64 uFreeSpace;
588  sal_uInt32 uMaxNameLength;
590  sal_uInt32 uMaxPathLength;
593  rtl_uString *ustrFileSystemName;
595  oslVolumeDeviceHandle *pDeviceHandle;
596 } oslVolumeInfo;
597 
598 
636  rtl_uString *pustrDirectoryURL,
637  oslVolumeInfo *pInfo,
638  sal_uInt32 uFieldMask );
639 
640 typedef void *oslFileHandle;
641 
642 /* Open flags */
643 
644 #define osl_File_OpenFlag_Read 0x00000001L
645 #define osl_File_OpenFlag_Write 0x00000002L
646 #define osl_File_OpenFlag_Create 0x00000004L
647 #define osl_File_OpenFlag_NoLock 0x00000008L
648 /* larger bit-fields reserved for internal use cf. detail/file.h */
649 
706  rtl_uString *pustrFileURL, oslFileHandle *pHandle, sal_uInt32 uFlags );
707 
708 #define osl_Pos_Absolut 1
709 #define osl_Pos_Current 2
710 #define osl_Pos_End 3
711 
733  oslFileHandle Handle, sal_uInt32 uHow, sal_Int64 uPos ) SAL_WARN_UNUSED_RESULT;
734 
735 
756  oslFileHandle Handle, sal_uInt64 *pPos );
757 
758 
782  oslFileHandle Handle, sal_uInt64 uSize );
783 
784 
807  oslFileHandle Handle, sal_uInt64 *pSize );
808 
809 
814 #define osl_File_MapFlag_RandomAccess ((sal_uInt32)(0x1))
815 
822 #define osl_File_MapFlag_WillNeed ((sal_uInt32)(0x2))
823 
838  oslFileHandle Handle,
839  void** ppAddr,
840  sal_uInt64 uLength,
841  sal_uInt64 uOffset,
842  sal_uInt32 uFlags
843 );
844 
845 
846 #ifndef ANDROID
847 
862  void* pAddr,
863  sal_uInt64 uLength
864 );
865 
866 #endif
867 
880  oslFileHandle Handle,
881  void* pAddr,
882  sal_uInt64 uLength
883 );
884 
885 
922  oslFileHandle Handle, void *pBuffer, sal_uInt64 uBytesRequested, sal_uInt64 *pBytesRead );
923 
924 
951  oslFileHandle Handle, sal_Bool *pIsEOF );
952 
953 
992  oslFileHandle Handle, const void *pBuffer, sal_uInt64 uBytesToWrite, sal_uInt64 *pBytesWritten );
993 
1001  oslFileHandle Handle,
1002  sal_uInt64 uOffset,
1003  void* pBuffer,
1004  sal_uInt64 uBytesRequested,
1005  sal_uInt64* pBytesRead
1006 );
1007 
1008 
1016  oslFileHandle Handle,
1017  sal_uInt64 uOffset,
1018  const void* pBuffer,
1019  sal_uInt64 uBytesToWrite,
1020  sal_uInt64* pBytesWritten
1021 );
1022 
1023 
1052  oslFileHandle Handle, sal_Sequence** ppSequence );
1053 
1088 SAL_DLLPUBLIC oslFileError SAL_CALL osl_syncFile( oslFileHandle Handle );
1089 
1107 SAL_DLLPUBLIC oslFileError SAL_CALL osl_closeFile( oslFileHandle Handle );
1108 
1109 
1137 SAL_DLLPUBLIC oslFileError SAL_CALL osl_createDirectory( rtl_uString* pustrDirectoryURL );
1138 
1139 
1168 SAL_DLLPUBLIC oslFileError SAL_CALL osl_removeDirectory( rtl_uString* pustrDirectoryURL );
1169 
1185 typedef void (SAL_CALL *oslDirectoryCreationCallbackFunc)(void* pData, rtl_uString* aDirectoryUrl);
1186 
1247  rtl_uString* aDirectoryUrl,
1248  oslDirectoryCreationCallbackFunc aDirectoryCreationCallbackFunc,
1249  void* pData);
1250 
1280  rtl_uString* pustrFileURL );
1281 
1282 
1310  rtl_uString* pustrSourceFileURL, rtl_uString *pustrDestFileURL );
1311 
1312 
1338  rtl_uString* pustrSourceFileURL, rtl_uString *pustrDestFileURL );
1339 
1340 
1363  rtl_uString *pustrRequestedURL, rtl_uString **ppustrValidURL);
1364 
1365 
1402  rtl_uString* pustrBaseDirectoryURL,
1403  rtl_uString *pustrRelativeFileURL,
1404  rtl_uString **ppustrAbsoluteFileURL );
1405 
1406 
1423  rtl_uString *pustrSystemPath, rtl_uString **ppustrFileURL);
1424 
1425 
1455  rtl_uString *pustrFileName, rtl_uString *pustrSearchPath, rtl_uString **ppustrFileURL );
1456 
1457 
1474  rtl_uString *pustrFileURL, rtl_uString **ppustrSystemPath);
1475 
1476 
1489 typedef sal_uInt32 (SAL_CALL *oslCalcTextWidthFunc)( rtl_uString *ustrText );
1490 
1491 
1514  rtl_uString *ustrSystemPath,
1515  rtl_uString **pustrCompacted,
1516  sal_uInt32 uMaxWidth,
1517  oslCalcTextWidthFunc pCalcWidth );
1518 
1519 
1536  rtl_uString *pustrFileURL, sal_uInt64 uAttributes );
1537 
1538 
1562  rtl_uString *pustrFileURL,
1563  const TimeValue *aCreationTime,
1564  const TimeValue *aLastAccessTime,
1565  const TimeValue *aLastWriteTime);
1566 
1567 
1579  rtl_uString **pustrTempDirURL );
1580 
1581 
1634  rtl_uString* pustrDirectoryURL,
1635  oslFileHandle* pHandle,
1636  rtl_uString** ppustrTempFileURL);
1637 
1638 #ifdef __cplusplus
1639 }
1640 #endif
1641 
1642 #endif /* _OSL_FILE_H_ */
1643 
1644 
1645 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */