blob: 7317f83c66817e7f927c59b14658a2a5500a12f0 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Skia: include/core/SkOSFile.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
<h1>include/core/SkOSFile.h</h1><a href="_sk_o_s_file_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2006 The Android Open Source Project</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span>
<a name="l00005"></a>00005 <span class="comment"> * you may not use this file except in compliance with the License.</span>
<a name="l00006"></a>00006 <span class="comment"> * You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016
<a name="l00017"></a>00017 <span class="comment">// </span>
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef SkOSFile_DEFINED</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define SkOSFile_DEFINED</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &quot;<a class="code" href="_sk_string_8h.html">SkString.h</a>&quot;</span>
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="preprocessor">#if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor"> #include &lt;dirent.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#endif</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span>
<a name="l00027"></a>00027 <span class="keyword">struct </span>SkFILE;
<a name="l00028"></a>00028
<a name="l00029"></a><a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24">00029</a> <span class="keyword">enum</span> <a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24">SkFILE_Flags</a> {
<a name="l00030"></a><a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24a602c81ebe31ac6928858a25bb1e6de2a">00030</a> <a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24a602c81ebe31ac6928858a25bb1e6de2a">kRead_SkFILE_Flag</a> = 0x01,
<a name="l00031"></a><a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24a6b636e42f788845089ebef1a768c4d10">00031</a> <a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24a6b636e42f788845089ebef1a768c4d10">kWrite_SkFILE_Flag</a> = 0x02
<a name="l00032"></a>00032 };
<a name="l00033"></a>00033
<a name="l00034"></a>00034 SkFILE* <a class="code" href="_sk_o_s_file_8h.html#ab44f51fd66d9edcf72b4fde7a43796f7">sk_fopen</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> path[], <a class="code" href="_sk_o_s_file_8h.html#aae6d90a0d7f9490b613d1d6f25bffa24">SkFILE_Flags</a>);
<a name="l00035"></a>00035 <span class="keywordtype">void</span> <a class="code" href="_sk_o_s_file_8h.html#af63efe03b1ff0e4eecc33bdb2e14f876">sk_fclose</a>(SkFILE*);
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="keywordtype">size_t</span> <a class="code" href="_sk_o_s_file_8h.html#afe2b8c6bb78bf80560658a0bc019e5b2">sk_fgetsize</a>(SkFILE*);
<a name="l00040"></a>00040 <span class="keywordtype">bool</span> <a class="code" href="_sk_o_s_file_8h.html#a1a0b86f815a4c9d8c781cb22b3a95459">sk_frewind</a>(SkFILE*);
<a name="l00041"></a>00041
<a name="l00042"></a>00042 <span class="keywordtype">size_t</span> <a class="code" href="_sk_o_s_file_8h.html#ab666ac630a09bb86aeadff6eaf2b35de">sk_fread</a>(<span class="keywordtype">void</span>* buffer, <span class="keywordtype">size_t</span> byteCount, SkFILE*);
<a name="l00043"></a>00043 <span class="keywordtype">size_t</span> <a class="code" href="_sk_o_s_file_8h.html#a2b67a0456bd854de78ee0b17c85189c7">sk_fwrite</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>* buffer, <span class="keywordtype">size_t</span> byteCount, SkFILE*);
<a name="l00044"></a>00044 <span class="keywordtype">void</span> <a class="code" href="_sk_o_s_file_8h.html#ad28e644cfefc1fb98c3e1132e0c84f1a">sk_fflush</a>(SkFILE*);
<a name="l00045"></a>00045
<a name="l00046"></a>00046 <span class="keywordtype">int</span> <a class="code" href="_sk_o_s_file_8h.html#a7568186daf6b89a388d3d9a41f8df7ee">sk_fseek</a>( SkFILE*, <span class="keywordtype">size_t</span>, <span class="keywordtype">int</span> );
<a name="l00047"></a>00047 <span class="keywordtype">size_t</span> <a class="code" href="_sk_o_s_file_8h.html#aee4135e43e9c07aa0f98d49db1ee537c">sk_ftell</a>( SkFILE* );
<a name="l00048"></a>00048
<a name="l00049"></a><a class="code" href="class_sk_o_s_file.html">00049</a> <span class="keyword">class </span><a class="code" href="class_sk_o_s_file.html">SkOSFile</a> {
<a name="l00050"></a>00050 <span class="keyword">public</span>:
<a name="l00051"></a><a class="code" href="class_sk_o_s_file_1_1_iter.html">00051</a> <span class="keyword">class </span><a class="code" href="class_sk_o_s_file_1_1_iter.html">Iter</a> {
<a name="l00052"></a>00052 <span class="keyword">public</span>:
<a name="l00053"></a>00053 <a class="code" href="class_sk_o_s_file_1_1_iter.html#a566e6eac3121ab2147eb4ef0725da9e6">Iter</a>();
<a name="l00054"></a>00054 <a class="code" href="class_sk_o_s_file_1_1_iter.html#a566e6eac3121ab2147eb4ef0725da9e6">Iter</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> path[], <span class="keyword">const</span> <span class="keywordtype">char</span> suffix[] = NULL);
<a name="l00055"></a>00055 <a class="code" href="class_sk_o_s_file_1_1_iter.html#ae2b18bb2544b778ff5c889ba50dcc10a">~Iter</a>();
<a name="l00056"></a>00056
<a name="l00057"></a>00057 <span class="keywordtype">void</span> <a class="code" href="class_sk_o_s_file_1_1_iter.html#a1bbf6d4233d67cd98da45af0d997a671">reset</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> path[], <span class="keyword">const</span> <span class="keywordtype">char</span> suffix[] = NULL);
<a name="l00058"></a>00058 <span class="keywordtype">bool</span> <a class="code" href="class_sk_o_s_file_1_1_iter.html#a85a0fe67a551250323291237ae524223">next</a>(<a class="code" href="class_sk_string.html">SkString</a>* name, <span class="keywordtype">bool</span> getDir = <span class="keyword">false</span>);
<a name="l00059"></a>00059
<a name="l00060"></a>00060 <span class="keyword">private</span>:
<a name="l00061"></a>00061 <span class="preprocessor">#ifdef SK_BUILD_FOR_WIN</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span> HANDLE fHandle;
<a name="l00063"></a>00063 uint16_t* fPath16;
<a name="l00064"></a>00064 <span class="preprocessor">#elif defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_UNIX)</span>
<a name="l00065"></a>00065 <span class="preprocessor"></span> DIR* fDIR;
<a name="l00066"></a>00066 <a class="code" href="class_sk_string.html">SkString</a> fPath, fSuffix;
<a name="l00067"></a>00067 <span class="preprocessor">#endif</span>
<a name="l00068"></a>00068 <span class="preprocessor"></span> };
<a name="l00069"></a>00069 };
<a name="l00070"></a>00070
<a name="l00071"></a><a class="code" href="class_sk_u_t_f16___str.html">00071</a> <span class="keyword">class </span><a class="code" href="class_sk_u_t_f16___str.html">SkUTF16_Str</a> {
<a name="l00072"></a>00072 <span class="keyword">public</span>:
<a name="l00073"></a>00073 <a class="code" href="class_sk_u_t_f16___str.html#a4f852731fc81f14a78bc9d6f008cd9cf">SkUTF16_Str</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> src[]);
<a name="l00074"></a><a class="code" href="class_sk_u_t_f16___str.html#a80c30bedfc99f552aa9886ba201c5cde">00074</a> <a class="code" href="class_sk_u_t_f16___str.html#a80c30bedfc99f552aa9886ba201c5cde">~SkUTF16_Str</a>()
<a name="l00075"></a>00075 {
<a name="l00076"></a>00076 <a class="code" href="_sk_types_8h.html#a9f1146592afd72a09a2fc3477eeb3c82">sk_free</a>(fStr);
<a name="l00077"></a>00077 }
<a name="l00078"></a><a class="code" href="class_sk_u_t_f16___str.html#a34d9e1d10ec9f057d7e8ef3242b7e3cf">00078</a> <span class="keyword">const</span> uint16_t* <span class="keyword">get</span>() <span class="keyword">const</span> { <span class="keywordflow">return</span> fStr; }
<a name="l00079"></a>00079
<a name="l00080"></a>00080 <span class="keyword">private</span>:
<a name="l00081"></a>00081 uint16_t* fStr;
<a name="l00082"></a>00082 };
<a name="l00083"></a>00083
<a name="l00084"></a>00084 <span class="preprocessor">#endif</span>
<a name="l00085"></a>00085 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Tue Oct 20 11:03:40 2009 for Skia by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>