C/C++ User's Journal STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - where the Standard Template Library meets the Active Template Library COMSTL - where the Standard Template Library meets the Component Object Model
Synesis Software InetSTL - where the Standard Template Library meets the Internet UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

Main Page   Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

/include/recls/cpp/fileentry.hpp

Go to the documentation of this file.
00001 /* 
00002  * File:        recls/cpp/fileentry.hpp
00003  *
00004  * Purpose:     recls C++ mapping - FileEntry class.
00005  *
00006  * Created:     18th August 2003
00007  * Updated:     27th December 2005
00008  *
00009  * Home:        http://recls.org/
00010  *
00011  * Copyright (c) 2003-2005, Matthew Wilson and Synesis Software
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without 
00015  * modification, are permitted provided that the following conditions are met:
00016  *
00017  * - Redistributions of source code must retain the above copyright notice, this
00018  *   list of conditions and the following disclaimer. 
00019  * - Redistributions in binary form must reproduce the above copyright notice,
00020  *   this list of conditions and the following disclaimer in the documentation
00021  *   and/or other materials provided with the distribution.
00022  * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of
00023  *   any contributors may be used to endorse or promote products derived from
00024  *   this software without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00027  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00029  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00030  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00031  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00032  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00033  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00034  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00035  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00036  * POSSIBILITY OF SUCH DAMAGE.
00037  *
00038  * 
00039 
00040 
00041 #ifndef RECLS_INCL_RECLS_CPP_HPP_FILEENTRY
00042 #define RECLS_INCL_RECLS_CPP_HPP_FILEENTRY
00043 
00044 /* File version */
00045 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00046 # define RECLS_VER_RECLS_CPP_HPP_FILEENTRY_MAJOR    3
00047 # define RECLS_VER_RECLS_CPP_HPP_FILEENTRY_MINOR    0
00048 # define RECLS_VER_RECLS_CPP_HPP_FILEENTRY_REVISION 4
00049 # define RECLS_VER_RECLS_CPP_HPP_FILEENTRY_EDIT     38
00050 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */
00051 
00056 /* 
00057  * Includes
00058  */
00059 
00060 #include <recls/cpp/recls.hpp>
00061 #include <recls/assert.h>
00062 
00063 #include <stlsoft/operator_bool.hpp>    // For operator bool() stuff
00064 #if defined(RECLS_PLATFORM_IS_WIN32)
00065 # include <winstl/file_path_buffer.hpp>
00066 #elif defined(RECLS_PLATFORM_IS_UNIX)
00067 # include <unixstl/file_path_buffer.hpp>
00068 #else
00069 # error Platform not (yet) recognised
00070 #endif /* platform */
00071 
00072 /* 
00073  * Namespace
00074  */
00075 
00076 #if !defined(RECLS_NO_NAMESPACE)
00077 namespace recls
00078 {
00079 
00080 namespace cpp
00081 {
00082 #endif /* !RECLS_NO_NAMESPACE */
00083 
00084 #if defined(RECLS_PLATFORM_IS_WIN32)
00085 typedef winstl::basic_file_path_buffer<recls_char_t>    file_path_buffer;
00086 #elif defined(RECLS_PLATFORM_IS_UNIX)
00087 typedef unixstl::basic_file_path_buffer<recls_char_t>   file_path_buffer;
00088 #else
00089 # error Platform not (yet) recognised
00090 #endif /* platform */
00091 
00092 /* 
00093  * Forward declarations
00094  */
00095 
00096 class FileEntry;
00097 class FileSearch;
00098 
00099 /* 
00100  * Classes
00101  */
00102 
00106 class DirectoryParts_class
00107 {
00108 public:
00109     typedef recls_char_t            char_type;
00110     typedef DirectoryParts_class    class_type;
00111 
00112 // Construction
00113 private:
00114     friend class FileEntry;
00115     DirectoryParts_class(recls_info_t info);
00116 
00119 public:
00121     DirectoryParts_class();
00123     DirectoryParts_class(class_type const &rhs);
00125     ~DirectoryParts_class();
00126 
00128     class_type &operator =(class_type const &rhs);
00129 
00131 
00134 public:
00136     size_t      size() const;
00142     string_t    operator [](size_t index) const;
00143 
00145 
00146 // Implementation
00147 private:
00148     static recls_info_t copy_info_(recls_info_t info);
00149 
00150 // Members
00151 private:
00152     recls_info_t    m_info;
00153 };
00154 
00158 class FileEntry
00159 {
00160 public:
00161     typedef recls_char_t    char_type;
00162     typedef FileEntry       class_type;
00163 
00164 // Construction
00165 private:
00166     friend class Search;
00167     FileEntry(recls_info_t info);
00168 
00171 public:
00173     FileEntry();
00175     FileEntry(FileEntry const &rhs);
00177     ~FileEntry();
00178 
00180     FileEntry &operator =(FileEntry const &rhs);
00182 
00185 private:
00186     STLSOFT_DEFINE_OPERATOR_BOOL_TYPES(class_type, boolean_generator_type, boolean_type);
00187 public:
00189     operator boolean_type() const
00190     {
00191         return boolean_generator_type::translate(NULL != m_info);
00192     }
00193 
00194 #ifndef STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
00195 
00196     bool operator !() const;
00197 #endif /* !STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */
00198 
00200 
00203 public:
00204 #ifndef RECLS_PURE_API
00205 
00206     char_type const     *c_str() const;
00207 #endif /* !RECLS_PURE_API */
00208 
00210     string_t            GetPath() const;
00212     string_t            GetSearchDirectory() const;
00214     string_t            GetSearchRelativePath() const;
00215 #ifdef RECLS_PLATFORM_API_WIN32
00216 
00217     char_type           GetDrive() const;
00218 #endif /* RECLS_PLATFORM_API_WIN32 */
00219 
00220     string_t            GetDirectory() const;
00222     string_t            GetDirectoryPath() const;
00224     string_t            GetUNCDrive() const;
00226     DirectoryParts_class      GetDirectoryParts() const;
00228     string_t            GetFile() const;
00232     string_t            GetShortFile() const;
00234     string_t            GetFileName() const;
00236     string_t            GetFileExt() const;
00237 
00241     recls_time_t        GetCreationTime() const;
00243     recls_time_t        GetModificationTime() const;
00245     recls_time_t        GetLastAccessTime() const;
00249     recls_time_t        GetLastStatusChangeTime() const;
00250 
00252     recls_filesize_t    GetSize() const;
00253 
00255     recls_bool_t        IsReadOnly() const;
00257     recls_bool_t        IsDirectory() const;
00259     recls_bool_t        IsLink() const;
00261     recls_bool_t        IsUNC() const;
00263 
00265 public:
00266 #ifdef RECLS_CPP_METHOD_PROPERTY_SUPPORT
00267     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, Path);
00268     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, SearchDirectory);
00269     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, SearchRelativePath);
00270 #ifdef RECLS_CPP_PLATFORM_API_WIN32
00271     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, Drive);
00272 #endif /* RECLS_CPP_PLATFORM_API_WIN32 */
00273     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, Directory);
00274     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, DirectoryPath);
00275     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, UNCDrive);
00276 #ifndef RECLS_CPP_PURE_API
00277     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, DirectoryParts);
00278 #endif /* !RECLS_CPP_PURE_API */
00279     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, File);
00280     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, ShortFile);
00281     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, FileName);
00282     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, FileExt);
00283     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, CreationTime);
00284     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, ModificationTime);
00285     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, LastAccessTime);
00286     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, LastStatusChangeTime);
00287     RECLS_CPP_OPT_METHOD_PROPERTY_DEFINE_OFFSET(class_type, Size);
00288 union
00289 {
00290     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetPath, Path);
00291     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetSearchDirectory, SearchDirectory);
00292     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetSearchRelativePath, SearchRelativePath);
00293 #ifdef RECLS_CPP_PLATFORM_API_WIN32
00294     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(char_type, class_type, GetDrive, Drive);
00295 #endif /* RECLS_CPP_PLATFORM_API_WIN32 */
00296     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetDirectory, Directory);
00297     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetDirectoryPath, DirectoryPath);
00298     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetUNCDrive, UNCDrive);
00299 #ifndef RECLS_CPP_PURE_API
00300     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(DirectoryParts_class, class_type, GetDirectoryParts, DirectoryParts);
00301 #endif /* !RECLS_CPP_PURE_API */
00302     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetFile, File);
00303     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetShortFile, ShortFile);
00304     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetFileName, FileName);
00305     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(string_t, class_type, GetFileExt, FileExt);
00306     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(recls_time_t, class_type, GetCreationTime, CreationTime);
00307     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(recls_time_t, class_type, GetModificationTime, ModificationTime);
00308     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(recls_time_t, class_type, GetLastAccessTime, LastAccessTime);
00309     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(recls_time_t, class_type, GetLastStatusChangeTime, LastStatusChangeTime);
00310     RECLS_CPP_OPT_METHOD_PROPERTY_GET_PROP(recls_filesize_t, class_type, GetSize, Size);
00311 };
00312 #endif /* RECLS_CPP_METHOD_PROPERTY_SUPPORT */
00313 
00314 
00315 // Implementation
00316 private:
00317     static recls_info_t copy_info_(recls_info_t info);
00318 #ifdef RECLS_PURE_API
00319     // Note: this has to be inside the class because GCC is a real dummy n this regard.
00320     static string_t     get_string_(size_t (RECLS_CALLCONV_DEFAULT *pfn)(recls_info_t, recls_char_t *, size_t), recls_info_t info);
00321     {
00322         file_path_buffer    buffer;
00323         size_t              cch =   pfn(info, &buffer[0], buffer.size());
00324 
00325         return string_t(&buffer[0], cch);
00326     }
00327 #endif /* RECLS_PURE_API */
00328 
00329 // Members
00330 private:
00331     recls_info_t    m_info;
00332 };
00333 
00334 typedef DirectoryParts_class    DirectoryParts;
00335 
00336 /* 
00337  * Shims
00338  */
00339 
00340 #ifndef RECLS_PURE_API
00351 inline FileEntry::char_type const *c_str_ptr(FileEntry const &fe)
00352 {
00353     return fe.c_str();
00354 }
00355 #endif /* !RECLS_PURE_API */
00356 
00357 /* 
00358  * Implementation
00359  */
00360 
00361 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00362 
00363 inline /* static */ recls_info_t DirectoryParts_class::copy_info_(recls_info_t info)
00364 {
00365     recls_info_t    newInfo;
00366 
00367     if( NULL == info ||
00368         RECLS_FAILED(Recls_CopyDetails(info, &newInfo)))
00369     {
00370         newInfo = NULL;
00371     }
00372 
00373     return newInfo;
00374 }
00375 
00376 inline DirectoryParts_class::DirectoryParts_class(recls_info_t info)
00377     : m_info(copy_info_(info))
00378 {}
00379 
00380 inline DirectoryParts_class::DirectoryParts_class()
00381     : m_info(NULL)
00382 {}
00383 
00384 inline DirectoryParts_class::DirectoryParts_class(DirectoryParts_class const &rhs)
00385     : m_info(copy_info_(rhs.m_info))
00386 {}
00387 
00388 inline DirectoryParts_class::~DirectoryParts_class()
00389 {
00390     Recls_CloseDetails(m_info);
00391 }
00392 
00393 inline DirectoryParts_class &DirectoryParts_class::operator =(DirectoryParts_class const &rhs)
00394 {
00395     Recls_CloseDetails(m_info);
00396 
00397     m_info = copy_info_(rhs.m_info);
00398 
00399     return *this;
00400 }
00401 
00402 inline size_t DirectoryParts_class::size() const
00403 {
00404     return Recls_GetDirectoryPartProperty(m_info, -1, NULL, 0);
00405 }
00406 
00407 inline string_t DirectoryParts_class::operator [](size_t index) const
00408 {
00409     file_path_buffer    dirPart;
00410 
00411     RECLS_ASSERT(NULL != m_info);
00412     RECLS_ASSERT(index < size());
00413 
00414     return Recls_GetDirectoryPartProperty(m_info, static_cast<int>(index), &dirPart[0], dirPart.size()) ? string_t(dirPart.c_str()) : string_t();
00415 }
00416 
00417 inline /* static */ recls_info_t FileEntry::copy_info_(recls_info_t info)
00418 {
00419     recls_info_t    newInfo;
00420 
00421     if( NULL == info ||
00422         RECLS_FAILED(Recls_CopyDetails(info, &newInfo)))
00423     {
00424         newInfo = NULL;
00425     }
00426 
00427     return newInfo;
00428 }
00429 
00430 inline FileEntry::FileEntry(recls_info_t info)
00431     : m_info(info)
00432 {}
00433 
00434 inline FileEntry::FileEntry()
00435     : m_info(NULL)
00436 {}
00437 
00438 inline FileEntry::FileEntry(FileEntry const &rhs)
00439     : m_info(copy_info_(rhs.m_info))
00440 {}
00441 
00442 inline FileEntry::~FileEntry()
00443 {
00444     if(NULL != m_info)
00445     {
00446         Recls_CloseDetails(m_info);
00447     }
00448 }
00449 
00450 inline FileEntry &FileEntry::operator =(FileEntry const &rhs)
00451 {
00452     Recls_CloseDetails(m_info);
00453 
00454     m_info = copy_info_(rhs.m_info);
00455 
00456     return *this;
00457 }
00458 
00459 #ifndef STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT
00460 inline bool FileEntry::operator !() const
00461 {
00462     return (*this) ? false : true;
00463 }
00464 #endif /* !STLSOFT_CF_OPERATOR_NOT_VIA_OPERATOR_POINTER_TO_MEMBER_SUPPORT */
00465 
00466 
00467 #ifndef RECLS_PURE_API
00468 inline FileEntry::char_type const *FileEntry::c_str() const
00469 {
00470     return (NULL != m_info) ? m_info->path.begin : "";
00471 }
00472 #endif /* !RECLS_PURE_API */
00473 
00474 inline string_t FileEntry::GetPath() const
00475 {
00476     RECLS_ASSERT(NULL != m_info);
00477 
00478 #ifdef RECLS_PURE_API
00479     return get_string_(Recls_GetPathProperty, m_info);
00480 #else /* ? RECLS_PURE_API */
00481     return string_t(m_info->path.begin, m_info->path.end);
00482 #endif /* RECLS_PURE_API */
00483 }
00484 
00485 inline string_t FileEntry::GetSearchDirectory() const
00486 {
00487     RECLS_ASSERT(NULL != m_info);
00488 
00489 #ifdef RECLS_PURE_API
00490     return get_string_(Recls_GetSearchDirectoryProperty, m_info);
00491 #else /* ? RECLS_PURE_API */
00492     return string_t(m_info->searchDirectory.begin, m_info->searchDirectory.end);
00493 #endif /* RECLS_PURE_API */
00494 }
00495 
00496 inline string_t FileEntry::GetSearchRelativePath() const
00497 {
00498     RECLS_ASSERT(NULL != m_info);
00499 
00500 #ifdef RECLS_PURE_API
00501     return get_string_(Recls_GetSearchRelativePathProperty, m_info);
00502 #else /* ? RECLS_PURE_API */
00503     return string_t(m_info->searchRelativePath.begin, m_info->searchRelativePath.end);
00504 #endif /* RECLS_PURE_API */
00505 }
00506 
00507 #ifdef RECLS_PLATFORM_API_WIN32
00508 inline FileEntry::char_type FileEntry::GetDrive() const
00509 {
00510     char_type chDrive;
00511 
00512     return (Recls_GetDriveProperty(m_info, &chDrive), chDrive);
00513 }
00514 #endif /* RECLS_PLATFORM_API_WIN32 */
00515 
00516 inline string_t FileEntry::GetDirectory() const
00517 {
00518     RECLS_ASSERT(NULL != m_info);
00519 
00520 #ifdef RECLS_PURE_API
00521     return get_string_(Recls_GetDirectoryProperty, m_info);
00522 #else /* ? RECLS_PURE_API */
00523     return string_t(m_info->directory.begin, m_info->directory.end);
00524 #endif /* RECLS_PURE_API */
00525 }
00526 
00527 inline string_t FileEntry::GetDirectoryPath() const
00528 {
00529     RECLS_ASSERT(NULL != m_info);
00530 
00531 #ifdef RECLS_PURE_API
00532     return get_string_(Recls_GetDirectoryPathProperty, m_info);
00533 #else /* ? RECLS_PURE_API */
00534     return string_t(m_info->path.begin, m_info->directory.end);
00535 #endif /* RECLS_PURE_API */
00536 }
00537 
00538 inline string_t FileEntry::GetUNCDrive() const
00539 {
00540     RECLS_ASSERT(NULL != m_info);
00541 
00542 #if 0
00543     if(!IsUNC())
00544     {
00545         return string_t();
00546     }
00547     else
00548     {
00549 #ifdef RECLS_PURE_API
00550         string_t    directoryPath   =   GetDirectoryPath();
00551         size_t      directoryLen    =   Recls_GetDirectoryProperty(m_info, NULL, 0);
00552 
00553         return string_t(directoryPath, 0, directoryPath.length() - directoryLen);
00554 #else /* ? RECLS_PURE_API */
00555         return string_t(m_info->path.begin, m_info->directory.begin);
00556 #endif /* RECLS_PURE_API */
00557     }
00558 #else /* ? 0 */
00559 # ifdef RECLS_PURE_API
00560     return get_string_(Recls_GetUNCDriveProperty, m_info);
00561 # else /* ? RECLS_PURE_API */
00562     return string_t(m_info->path.begin, m_info->directory.begin);
00563 # endif /* RECLS_PURE_API */
00564 #endif /* 0 */
00565 }
00566 
00567 inline recls::cpp::DirectoryParts_class FileEntry::GetDirectoryParts() const
00568 {
00569     RECLS_ASSERT(NULL != m_info);
00570 
00571     return recls::cpp::DirectoryParts_class(m_info);
00572 }
00573 
00574 inline string_t FileEntry::GetFile() const
00575 {
00576     RECLS_ASSERT(NULL != m_info);
00577 
00578 #ifdef RECLS_PURE_API
00579     return get_string_(Recls_GetFileProperty, m_info);
00580 #else /* ? RECLS_PURE_API */
00581     RECLS_ASSERT(m_info->fileName.begin <= m_info->fileExt.end);
00582     return string_t(m_info->fileName.begin, m_info->fileExt.end);
00583 #endif /* RECLS_PURE_API */
00584 }
00585 
00586 inline string_t FileEntry::GetShortFile() const
00587 {
00588 #ifdef RECLS_PLATFORM_API_WIN32
00589     RECLS_ASSERT(NULL != m_info);
00590 
00591     return string_t(m_info->shortFile.begin, m_info->shortFile.end);
00592 #else
00593     return GetFile();
00594 #endif /* RECLS_PLATFORM_API_WIN32 */
00595 }
00596 
00597 inline string_t FileEntry::GetFileName() const
00598 {
00599     RECLS_ASSERT(NULL != m_info);
00600 
00601 #ifdef RECLS_PURE_API
00602     return get_string_(Recls_GetFileNameProperty, m_info);
00603 #else /* ? RECLS_PURE_API */
00604     return string_t(m_info->fileName.begin, m_info->fileName.end);
00605 #endif /* RECLS_PURE_API */
00606 }
00607 
00608 inline string_t FileEntry::GetFileExt() const
00609 {
00610     RECLS_ASSERT(NULL != m_info);
00611 
00612 #ifdef RECLS_PURE_API
00613     return get_string_(Recls_GetFileExtProperty, m_info);
00614 #else /* ? RECLS_PURE_API */
00615     return string_t(m_info->fileExt.begin, m_info->fileExt.end);
00616 #endif /* RECLS_PURE_API */
00617 }
00618 
00619 inline recls_time_t FileEntry::GetCreationTime() const
00620 {
00621     RECLS_ASSERT(NULL != m_info);
00622 
00623     return Recls_GetCreationTime(m_info);
00624 }
00625 
00626 inline recls_time_t FileEntry::GetModificationTime() const
00627 {
00628     RECLS_ASSERT(NULL != m_info);
00629 
00630     return Recls_GetModificationTime(m_info);
00631 }
00632 
00633 inline recls_time_t FileEntry::GetLastAccessTime() const
00634 {
00635     RECLS_ASSERT(NULL != m_info);
00636 
00637     return Recls_GetLastAccessTime(m_info);
00638 }
00639 
00640 inline recls_time_t FileEntry::GetLastStatusChangeTime() const
00641 {
00642     RECLS_ASSERT(NULL != m_info);
00643 
00644     return Recls_GetLastStatusChangeTime(m_info);
00645 }
00646 
00647 inline recls_filesize_t FileEntry::GetSize() const
00648 {
00649     RECLS_ASSERT(NULL != m_info);
00650 
00651 #ifdef RECLS_PURE_API
00652     recls_filesize_t    size;
00653 
00654     return (Recls_GetSizeProperty(m_info, &size), size);
00655 #else /* ? RECLS_PURE_API */
00656     return m_info->size;
00657 #endif /* RECLS_PURE_API */
00658 }
00659 
00660 inline recls_bool_t FileEntry::IsReadOnly() const
00661 {
00662     RECLS_ASSERT(NULL != m_info);
00663 
00664     return Recls_IsFileReadOnly(m_info);
00665 }
00666 
00667 inline recls_bool_t FileEntry::IsDirectory() const
00668 {
00669     RECLS_ASSERT(NULL != m_info);
00670 
00671     return Recls_IsFileDirectory(m_info);
00672 }
00673 
00674 inline recls_bool_t FileEntry::IsLink() const
00675 {
00676     RECLS_ASSERT(NULL != m_info);
00677 
00678     return Recls_IsFileLink(m_info);
00679 }
00680 
00681 inline recls_bool_t FileEntry::IsUNC() const
00682 {
00683     RECLS_ASSERT(NULL != m_info);
00684 
00685     return Recls_IsFileUNC(m_info);
00686 }
00687 
00688 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */
00689 
00690 /* 
00691  * Namespace
00692  */
00693 
00694 #if !defined(RECLS_NO_NAMESPACE)
00695 } /* namespace cpp */
00696 } /* namespace recls */
00697 #endif /* !RECLS_NO_NAMESPACE */
00698 
00699 /* 
00700 
00701 #endif /* !RECLS_INCL_RECLS_CPP_HPP_FILEENTRY */
00702 
00703 /* 

recls Library documentation © Synesis Software Pty Ltd, 2001-2005