blob: 42bd444d13585d24079222f79deccc8f1855825f [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Oscl_FileFind class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.2.18 -->
<center>
<a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="modules.html">Modules</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Data Structures</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Data Fields</a> &nbsp; <a class="qindex" href="globals.html">Globals</a> &nbsp; </center>
<hr><h1>Oscl_FileFind Class Reference<br>
<small>
[<a class="el" href="group__osclio.html">OSCL IO</a>]</small>
</h1><code>#include &lt;<a class="el" href="oscl__file__find_8h-source.html">oscl_file_find.h</a>&gt;</code>
<p>
<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
<tr><td nowrap align=right valign=top>enum &nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#s13">error_type</a> { <br>
&nbsp;&nbsp;<a class="el" href="classOscl__FileFind.html#s13s0">E_OK</a> = 0,
<a class="el" href="classOscl__FileFind.html#s13s1">E_INVALID_STATE</a>,
<a class="el" href="classOscl__FileFind.html#s13s2">E_INVALID_ARG</a>,
<a class="el" href="classOscl__FileFind.html#s13s3">E_PATH_TOO_LONG</a>,
<br>
&nbsp;&nbsp;<a class="el" href="classOscl__FileFind.html#s13s4">E_PATH_NOT_FOUND</a>,
<a class="el" href="classOscl__FileFind.html#s13s5">E_NO_MATCH</a>,
<a class="el" href="classOscl__FileFind.html#s13s6">E_BUFFER_TOO_SMALL</a>,
<a class="el" href="classOscl__FileFind.html#s13s7">E_NOT_IMPLEMENTED</a>,
<br>
&nbsp;&nbsp;<a class="el" href="classOscl__FileFind.html#s13s8">E_MEMORY_ERROR</a>,
<a class="el" href="classOscl__FileFind.html#s13s9">E_OTHER</a>
<br>
}</td></tr>
<tr><td nowrap align=right valign=top>enum &nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#s14">element_type</a> { <a class="el" href="classOscl__FileFind.html#s14s10">FILE_TYPE</a> = 0,
<a class="el" href="classOscl__FileFind.html#s14s11">DIR_TYPE</a>,
<a class="el" href="classOscl__FileFind.html#s14s12">INVALID_TYPE</a>
}</td></tr>
<tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF const char *&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a0">FindFirst</a> (const char *directory, const char *pattern, char *buf, uint32 buflen)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF const <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a1">FindFirst</a> (const <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *directory, const <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *pattern, <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *buf, uint32 buflen)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF char *&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a2">FindNext</a> (char *buf, uint32 buflen)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a3">FindNext</a> (<a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *buf, uint32 buflen)</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF void&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a4">Close</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOscl__FileFind.html#s14">element_type</a>&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a5">GetElementType</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF <a class="el" href="classOscl__FileFind.html#s13">error_type</a>&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a6">GetLastError</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a7">Oscl_FileFind</a> ()</td></tr>
<tr><td nowrap align=right valign=top>OSCL_IMPORT_REF&nbsp;</td><td valign=bottom><a class="el" href="classOscl__FileFind.html#a8">~Oscl_FileFind</a> ()</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Oscl_FileFind class defines the generic way of finding filesystem elements that match a pattern within a directory
<p>
<hr><h2>Member Enumeration Documentation</h2>
<a name="s14" doxytag="Oscl_FileFind::element_type"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum Oscl_FileFind::element_type
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a name="s14s10" doxytag="FILE_TYPE"></a><em>FILE_TYPE</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s14s11" doxytag="DIR_TYPE"></a><em>DIR_TYPE</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s14s12" doxytag="INVALID_TYPE"></a><em>INVALID_TYPE</em></em>&nbsp;</td><td>
</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a name="s13" doxytag="Oscl_FileFind::error_type"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> enum Oscl_FileFind::error_type
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
<dl compact><dt><b>Enumeration values: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em><a name="s13s0" doxytag="E_OK"></a><em>E_OK</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s1" doxytag="E_INVALID_STATE"></a><em>E_INVALID_STATE</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s2" doxytag="E_INVALID_ARG"></a><em>E_INVALID_ARG</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s3" doxytag="E_PATH_TOO_LONG"></a><em>E_PATH_TOO_LONG</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s4" doxytag="E_PATH_NOT_FOUND"></a><em>E_PATH_NOT_FOUND</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s5" doxytag="E_NO_MATCH"></a><em>E_NO_MATCH</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s6" doxytag="E_BUFFER_TOO_SMALL"></a><em>E_BUFFER_TOO_SMALL</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s7" doxytag="E_NOT_IMPLEMENTED"></a><em>E_NOT_IMPLEMENTED</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s8" doxytag="E_MEMORY_ERROR"></a><em>E_MEMORY_ERROR</em></em>&nbsp;</td><td>
</td></tr>
<tr><td valign=top><em><a name="s13s9" doxytag="E_OTHER"></a><em>E_OTHER</em></em>&nbsp;</td><td>
</td></tr>
</table>
</dl>
</td>
</tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a name="a7" doxytag="Oscl_FileFind::Oscl_FileFind"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF Oscl_FileFind::Oscl_FileFind </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
constructor. <dl compact><dt><b>Returns: </b></dt><dd>
none </dl> </td>
</tr>
</table>
<a name="a8" doxytag="Oscl_FileFind::~Oscl_FileFind"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF Oscl_FileFind::~Oscl_FileFind </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
destructor. will deallocate open handles if necessary
<p>
<dl compact><dt><b>Returns: </b></dt><dd>
none </dl> </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a name="a4" doxytag="Oscl_FileFind::Close"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF void Oscl_FileFind::Close </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
closes the handle to directory. <dl compact><dt><b>Returns: </b></dt><dd>
none </dl> </td>
</tr>
</table>
<a name="a1" doxytag="Oscl_FileFind::FindFirst"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF const <a class="el" href="group__osclbase.html#a32">oscl_wchar</a>* Oscl_FileFind::FindFirst </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>directory</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const <a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>pattern</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>uint32&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buflen</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Opens a directory for reading.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>directory</em>&nbsp;</td><td>
directory to search (utf16). </td></tr>
<tr><td valign=top><em>pattern</em>&nbsp;</td><td>
wildcard pattern filter (utf16). passing NULL, results in a universal match. </td></tr>
<tr><td valign=top><em>buf</em>&nbsp;</td><td>
buffer for returned pathname (utf16). </td></tr>
<tr><td valign=top><em>buflen</em>&nbsp;</td><td>
size in wide characters of buf. If buf is not large enough to hold the returned string, NULL is returned, and GetLastError is set to E_BUFFER_TOO_SMALL.</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
returns a pointer to buffer supplied, which contains the pathname of the next found element, or NULL otherwise. On a NULL return value, <a class="el" href="classOscl__FileFind.html#a6">GetLastError()</a> returns a more detailed error. </dl> </td>
</tr>
</table>
<a name="a0" doxytag="Oscl_FileFind::FindFirst"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF const char* Oscl_FileFind::FindFirst </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const char *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>directory</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>const char *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>pattern</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>char *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>uint32&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buflen</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Finds first element matching the pattern.<dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>directory</em>&nbsp;</td><td>
directory to search (utf8). </td></tr>
<tr><td valign=top><em>pattern</em>&nbsp;</td><td>
wildcard pattern filter (utf8). passing NULL, results in a universal match. </td></tr>
<tr><td valign=top><em>buf</em>&nbsp;</td><td>
buffer for returned pathname (utf8). </td></tr>
<tr><td valign=top><em>buflen</em>&nbsp;</td><td>
size in wide characters of buf. If buf is not large enough to hold the returned string, NULL is returned, and GetLastError is set to E_BUFFER_TOO_SMALL.</td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
returns a pointer to buffer supplied, which contains the pathname of the next found element, or NULL otherwise.On a NULL return value, <a class="el" href="classOscl__FileFind.html#a6">GetLastError()</a> returns a more detailed error. </dl> </td>
</tr>
</table>
<a name="a3" doxytag="Oscl_FileFind::FindNext"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="group__osclbase.html#a32">oscl_wchar</a>* Oscl_FileFind::FindNext </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top"><a class="el" href="group__osclbase.html#a32">oscl_wchar</a> *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>uint32&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buflen</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Reads the next element in a directory. Note: the pointer returned by this function is not persistent and should be stored. Its scope is limited to the lifetime of the class. <dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>buf</em>&nbsp;</td><td>
buffer to hold directory name(utf16) </td></tr>
<tr><td valign=top><em>buflen</em>&nbsp;</td><td>
size in wide characters of buf. If buf is not large enough to hold the returned string, NULL is returned, and GetLastError is set to E_BUFFER_TOO_SMALL. </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
returns a pointer to buffer supplied, which contains the pathname of the next found element, or NULL otherwise. On a NULL return value, <a class="el" href="classOscl__FileFind.html#a6">GetLastError()</a> returns a more detailed error. </dl> </td>
</tr>
</table>
<a name="a2" doxytag="Oscl_FileFind::FindNext"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF char* Oscl_FileFind::FindNext </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">char *&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buf</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap>uint32&nbsp;</td>
<td class="mdname" nowrap>&nbsp; <em>buflen</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Reads the next element in the directory. Note: the pointer returned by this function is not persistent and should be stored. Its scope is limited to the lifetime of the class. <dl compact><dt><b>Parameters: </b></dt><dd>
<table border=0 cellspacing=2 cellpadding=0>
<tr><td valign=top><em>buf</em>&nbsp;</td><td>
buffer to hold directory name(utf8) </td></tr>
<tr><td valign=top><em>buflen</em>&nbsp;</td><td>
size in wide characters of buf. If buf is not large enough to hold the returned string, NULL is returned, and GetLastError is set to E_BUFFER_TOO_SMALL. </td></tr>
</table>
</dl><dl compact><dt><b>Returns: </b></dt><dd>
returns a pointer to buffer supplied, which contains the pathname of the next found element, or NULL otherwise. On a NULL return value, <a class="el" href="classOscl__FileFind.html#a6">GetLastError()</a> returns a more detailed error. </dl> </td>
</tr>
</table>
<a name="a5" doxytag="Oscl_FileFind::GetElementType"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOscl__FileFind.html#s14">element_type</a> Oscl_FileFind::GetElementType </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the element type for the last element returned <dl compact><dt><b>Returns: </b></dt><dd>
see enumeration above for more info. </dl> </td>
</tr>
</table>
<a name="a6" doxytag="Oscl_FileFind::GetLastError"></a><p>
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td class="md">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> OSCL_IMPORT_REF <a class="el" href="classOscl__FileFind.html#s13">error_type</a> Oscl_FileFind::GetLastError </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap>&nbsp; </td>
<td class="md" valign="top">)&nbsp;</td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Returns the error code for the last operation. <dl compact><dt><b>Returns: </b></dt><dd>
see enumeration above for more info. </dl> </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="oscl__file__find_8h-source.html">oscl_file_find.h</a></ul>
<hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small>
<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small>
</small></address>
</body>
</html>