|
00001 /* 00002 * File: reclspp_filesearch.h 00003 * 00004 * Purpose: recls C++ mapping - FileSearch class. 00005 * 00006 * Created: 18th August 2003 00007 * Updated: 6th June 2004 00008 * 00009 * Author: Matthew Wilson, Synesis Software Pty Ltd. 00010 * 00011 * License: (Licensed under the Synesis Software Standard Source License) 00012 * 00013 * Copyright (C) 2002-2004, Synesis Software Pty Ltd. 00014 * 00015 * All rights reserved. 00016 * 00017 * www: http://www.synesis.com.au/software 00018 * http://www.recls.org/ 00019 * 00020 * email: submissions@recls.org for submissions 00021 * admin@recls.org for other enquiries 00022 * 00023 * Redistribution and use in source and binary forms, with or 00024 * without modification, are permitted provided that the following 00025 * conditions are met: 00026 * 00027 * (i) Redistributions of source code must retain the above 00028 * copyright notice and contact information, this list of 00029 * conditions and the following disclaimer. 00030 * 00031 * (ii) Any derived versions of this software (howsoever modified) 00032 * remain the sole property of Synesis Software. 00033 * 00034 * (iii) Any derived versions of this software (howsoever modified) 00035 * remain subject to all these conditions. 00036 * 00037 * (iv) Neither the name of Synesis Software nor the names of any 00038 * subdivisions, employees or agents of Synesis Software, nor the 00039 * names of any other contributors to this software may be used to 00040 * endorse or promote products derived from this software without 00041 * specific prior written permission. 00042 * 00043 * This source code is provided by Synesis Software "as is" and any 00044 * warranties, whether expressed or implied, including, but not 00045 * limited to, the implied warranties of merchantability and 00046 * fitness for a particular purpose are disclaimed. In no event 00047 * shall the Synesis Software be liable for any direct, indirect, 00048 * incidental, special, exemplary, or consequential damages 00049 * (including, but not limited to, procurement of substitute goods 00050 * or services; loss of use, data, or profits; or business 00051 * interruption) however caused and on any theory of liability, 00052 * whether in contract, strict liability, or tort (including 00053 * negligence or otherwise) arising in any way out of the use of 00054 * this software, even if advised of the possibility of such 00055 * damage. 00056 * 00057 * 00058 00059 00060 #ifndef RECLS_INCL_H_RECLSPP_FILESEARCH 00061 #define RECLS_INCL_H_RECLSPP_FILESEARCH 00062 00063 /* File version */ 00064 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION 00065 # define RECLS_VER_H_RECLSPP_FILESEARCH_MAJOR 1 00066 # define RECLS_VER_H_RECLSPP_FILESEARCH_MINOR 2 00067 # define RECLS_VER_H_RECLSPP_FILESEARCH_REVISION 1 00068 # define RECLS_VER_H_RECLSPP_FILESEARCH_EDIT 12 00069 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */ 00070 00075 /* 00076 * Includes 00077 */ 00078 00079 #include "reclspp.h" 00080 #include "reclspp_search.h" 00081 #include <recls_assert.h> 00082 00083 /* 00084 * Namespace 00085 */ 00086 00087 #if !defined(RECLS_NO_NAMESPACE) 00088 namespace recls 00089 { 00090 00091 namespace cpp 00092 { 00093 #endif /* !RECLS_NO_NAMESPACE */ 00094 00095 /* 00096 * Classes 00097 */ 00098 00102 class FileSearch 00103 : public Search 00104 { 00106 public: 00108 typedef FileSearch class_type; 00110 00113 public: 00119 FileSearch(recls_char_t const *rootDir, recls_char_t const *pattern, recls_uint32_t flags); 00121 ~FileSearch(); 00123 00124 // Implementation 00125 private: 00126 static ctor_args_type CreateSearch_(char const *rootDir, char const *pattern, recls_uint32_t flags) 00127 { 00128 hrecls_t hSrch; 00129 recls_rc_t rc = Recls_Search(rootDir, pattern, flags, &hSrch); 00130 00131 return Search::ctor_args_type(hSrch, rc); 00132 } 00133 00134 // Not to be implemented 00135 private: 00136 FileSearch(class_type const &rhs); 00137 class_type &operator =(class_type const &rhs); 00138 }; 00139 00140 /* 00141 * Implementation 00142 */ 00143 00144 inline FileSearch::FileSearch(recls_char_t const *rootDir, recls_char_t const *pattern, recls_uint32_t flags) 00145 : Search(CreateSearch_(rootDir, pattern, flags)) 00146 {} 00147 00148 inline FileSearch::~FileSearch() 00149 {} 00150 00151 /* 00152 * Namespace 00153 */ 00154 00155 #if !defined(RECLS_NO_NAMESPACE) 00156 } /* namespace cpp */ 00157 } /* namespace recls */ 00158 #endif /* !RECLS_NO_NAMESPACE */ 00159 00160 /* 00161 00162 #endif /* !RECLS_INCL_H_RECLSPP_FILESEARCH */ 00163 00164 /*
|
recls Library documentation © Synesis Software Pty Ltd, 2001-2004 |