\hypertarget{class_ogre_1_1_file_system_layer}{}\doxysection{Ogre\+::File\+System\+Layer Class Reference}
\label{class_ogre_1_1_file_system_layer}\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}


Provides methods to find out where the \mbox{\hyperlink{namespace_ogre}{Ogre}} config files are stored and where logs and settings files should be written to.  




{\ttfamily \#include $<$Ogre\+File\+System\+Layer.\+h$>$}



Inheritance diagram for Ogre\+::File\+System\+Layer\+:
\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=207pt]{class_ogre_1_1_file_system_layer__inherit__graph}
\end{center}
\end{figure}
\doxysubsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{class_ogre_1_1_file_system_layer_a7b8a94fb30ca04060b3c0b09b12af7c4}{File\+System\+Layer}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&subdir)
\begin{DoxyCompactList}\small\item\em Creates a concrete platform-\/dependent implementation of \mbox{\hyperlink{class_ogre_1_1_file_system_layer}{File\+System\+Layer}}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a7af51345a08a299fde4ec672b00ce9f8}{get\+Config\+File\+Path}} (\mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} filename) const
\begin{DoxyCompactList}\small\item\em Search for the given config file in a set of predefined locations. \end{DoxyCompactList}\item 
\mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a0e606f77e2deb5961b8001cbdfe35e22}{get\+Writable\+Path}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&filename) const
\begin{DoxyCompactList}\small\item\em Find a path where the given filename can be written to. \end{DoxyCompactList}\item 
void \mbox{\hyperlink{class_ogre_1_1_file_system_layer_aa2ab8206fdc0f858fbe27e94e3297dbf}{set\+Config\+Paths}} (const \mbox{\hyperlink{group___general_ga783e5227595f351519627abfb740ec85}{Ogre\+::\+String\+Vector}} \&paths)
\item 
void \mbox{\hyperlink{class_ogre_1_1_file_system_layer_afeaaf6f11cd5722e589a4c793d5a98cb}{set\+Home\+Path}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&path)
\end{DoxyCompactItemize}
\doxysubsection*{Static Public Member Functions}
\begin{DoxyCompactItemize}
\item 
static bool \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a0a2d92288292403038f30364043ee753}{create\+Directory}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&name)
\begin{DoxyCompactList}\small\item\em Create a directory. \end{DoxyCompactList}\item 
static bool \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a6566c95649770d52628853f5dfcf8ea6}{file\+Exists}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&path)
\begin{DoxyCompactList}\small\item\em Test if the given file exists. \end{DoxyCompactList}\item 
static bool \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a2fa242f9327be916ac34f699464698af}{remove\+Directory}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&name)
\begin{DoxyCompactList}\small\item\em Delete a directory. \end{DoxyCompactList}\item 
static bool \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a1fecc5387500843ef0c0c0b732824206}{remove\+File}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&path)
\begin{DoxyCompactList}\small\item\em Delete a file. \end{DoxyCompactList}\item 
static bool \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a09fa0a7da021d71cd7b6e2982d52effc}{rename\+File}} (const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&oldpath, const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&newpath)
\begin{DoxyCompactList}\small\item\em Rename a file. \end{DoxyCompactList}\item 
static \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a16c94bbb670ff33107cc568b73edae40}{resolve\+Bundle\+Path}} (\mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} path)
\begin{DoxyCompactList}\small\item\em Resolve path inside the application bundle on some platforms \mbox{\hyperlink{namespace_ogre}{Ogre}} is delivered as an application bundle this function resolves the given path such that it points inside that bundle. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
Provides methods to find out where the \mbox{\hyperlink{namespace_ogre}{Ogre}} config files are stored and where logs and settings files should be written to. 

In modern multi-\/user OS, a standard user account will often not have write access to the path where the application is stored. In order to still be able to store graphics settings and log output and for the user to overwrite the default \mbox{\hyperlink{namespace_ogre}{Ogre}} config files, this class tries to create a folder inside the user\textquotesingle{}s home directory. 

\doxysubsection{Constructor \& Destructor Documentation}
\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a7b8a94fb30ca04060b3c0b09b12af7c4}\label{class_ogre_1_1_file_system_layer_a7b8a94fb30ca04060b3c0b09b12af7c4}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!FileSystemLayer@{FileSystemLayer}}
\index{FileSystemLayer@{FileSystemLayer}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{FileSystemLayer()}{FileSystemLayer()}}
{\footnotesize\ttfamily Ogre\+::\+File\+System\+Layer\+::\+File\+System\+Layer (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{subdir }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}



Creates a concrete platform-\/dependent implementation of \mbox{\hyperlink{class_ogre_1_1_file_system_layer}{File\+System\+Layer}}. 


\begin{DoxyParams}{Parameters}
{\em subdir} & A subdirectory inside the user\textquotesingle{}s path to distinguish between different \mbox{\hyperlink{namespace_ogre}{Ogre}} applications. \\
\hline
\end{DoxyParams}


\doxysubsection{Member Function Documentation}
\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a7af51345a08a299fde4ec672b00ce9f8}\label{class_ogre_1_1_file_system_layer_a7af51345a08a299fde4ec672b00ce9f8}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!getConfigFilePath@{getConfigFilePath}}
\index{getConfigFilePath@{getConfigFilePath}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{getConfigFilePath()}{getConfigFilePath()}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} Ogre\+::\+File\+System\+Layer\+::get\+Config\+File\+Path (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}}}]{filename }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Search for the given config file in a set of predefined locations. 

The search order is
\begin{DoxyEnumerate}
\item Subdirectory in user Home (see \mbox{\hyperlink{class_ogre_1_1_file_system_layer_a0e606f77e2deb5961b8001cbdfe35e22}{get\+Writable\+Path}})
\item Executable path
\item Special system-\/wide config paths (only on Linux)
\item Current working directory
\end{DoxyEnumerate}


\begin{DoxyParams}{Parameters}
{\em filename} & The config file name (without path) \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The full path to the config file 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a0e606f77e2deb5961b8001cbdfe35e22}\label{class_ogre_1_1_file_system_layer_a0e606f77e2deb5961b8001cbdfe35e22}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!getWritablePath@{getWritablePath}}
\index{getWritablePath@{getWritablePath}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{getWritablePath()}{getWritablePath()}}
{\footnotesize\ttfamily \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} Ogre\+::\+File\+System\+Layer\+::get\+Writable\+Path (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{filename }\end{DoxyParamCaption}) const\hspace{0.3cm}{\ttfamily [inline]}}



Find a path where the given filename can be written to. 

This path will usually be a subdirectory in the user\textquotesingle{}s home directory. This function should be used for any output like logs and graphics settings.

\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{2}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Platform  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Location   }\\\cline{1-2}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Platform  }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Location   }\\\cline{1-2}
\endhead
Windows  &Documents/\+Ogre/\$subdir/   \\\cline{1-2}
Linux  &$\sim$/.cache/\$subdir/   \\\cline{1-2}
O\+SX  &$\sim$/\+Library/\+Application Support/\+Ogre/\$subdir/   \\\cline{1-2}
i\+OS  &N\+S\+Document\+Directory   \\\cline{1-2}
Android / Emscripten  &n/a   \\\cline{1-2}
\end{longtabu}



\begin{DoxyParams}{Parameters}
{\em filename} & Name of the file. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The full path to a writable location for the given filename. 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_aa2ab8206fdc0f858fbe27e94e3297dbf}\label{class_ogre_1_1_file_system_layer_aa2ab8206fdc0f858fbe27e94e3297dbf}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!setConfigPaths@{setConfigPaths}}
\index{setConfigPaths@{setConfigPaths}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{setConfigPaths()}{setConfigPaths()}}
{\footnotesize\ttfamily void Ogre\+::\+File\+System\+Layer\+::set\+Config\+Paths (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{group___general_ga783e5227595f351519627abfb740ec85}{Ogre\+::\+String\+Vector}} \&}]{paths }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_afeaaf6f11cd5722e589a4c793d5a98cb}\label{class_ogre_1_1_file_system_layer_afeaaf6f11cd5722e589a4c793d5a98cb}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!setHomePath@{setHomePath}}
\index{setHomePath@{setHomePath}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{setHomePath()}{setHomePath()}}
{\footnotesize\ttfamily void Ogre\+::\+File\+System\+Layer\+::set\+Home\+Path (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{path }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [inline]}}

\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a16c94bbb670ff33107cc568b73edae40}\label{class_ogre_1_1_file_system_layer_a16c94bbb670ff33107cc568b73edae40}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!resolveBundlePath@{resolveBundlePath}}
\index{resolveBundlePath@{resolveBundlePath}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{resolveBundlePath()}{resolveBundlePath()}}
{\footnotesize\ttfamily static \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}} Ogre\+::\+File\+System\+Layer\+::resolve\+Bundle\+Path (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{String}}}]{path }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Resolve path inside the application bundle on some platforms \mbox{\hyperlink{namespace_ogre}{Ogre}} is delivered as an application bundle this function resolves the given path such that it points inside that bundle. 


\begin{DoxyParams}{Parameters}
{\em path} & \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
path inside the bundle 
\end{DoxyReturn}
\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a0a2d92288292403038f30364043ee753}\label{class_ogre_1_1_file_system_layer_a0a2d92288292403038f30364043ee753}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!createDirectory@{createDirectory}}
\index{createDirectory@{createDirectory}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{createDirectory()}{createDirectory()}}
{\footnotesize\ttfamily static bool Ogre\+::\+File\+System\+Layer\+::create\+Directory (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Create a directory. 

\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a2fa242f9327be916ac34f699464698af}\label{class_ogre_1_1_file_system_layer_a2fa242f9327be916ac34f699464698af}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!removeDirectory@{removeDirectory}}
\index{removeDirectory@{removeDirectory}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{removeDirectory()}{removeDirectory()}}
{\footnotesize\ttfamily static bool Ogre\+::\+File\+System\+Layer\+::remove\+Directory (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{name }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Delete a directory. 

Should be empty \mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a6566c95649770d52628853f5dfcf8ea6}\label{class_ogre_1_1_file_system_layer_a6566c95649770d52628853f5dfcf8ea6}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!fileExists@{fileExists}}
\index{fileExists@{fileExists}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{fileExists()}{fileExists()}}
{\footnotesize\ttfamily static bool Ogre\+::\+File\+System\+Layer\+::file\+Exists (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{path }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Test if the given file exists. 

\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a1fecc5387500843ef0c0c0b732824206}\label{class_ogre_1_1_file_system_layer_a1fecc5387500843ef0c0c0b732824206}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!removeFile@{removeFile}}
\index{removeFile@{removeFile}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{removeFile()}{removeFile()}}
{\footnotesize\ttfamily static bool Ogre\+::\+File\+System\+Layer\+::remove\+File (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{path }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Delete a file. 

\mbox{\Hypertarget{class_ogre_1_1_file_system_layer_a09fa0a7da021d71cd7b6e2982d52effc}\label{class_ogre_1_1_file_system_layer_a09fa0a7da021d71cd7b6e2982d52effc}} 
\index{Ogre::FileSystemLayer@{Ogre::FileSystemLayer}!renameFile@{renameFile}}
\index{renameFile@{renameFile}!Ogre::FileSystemLayer@{Ogre::FileSystemLayer}}
\doxysubsubsection{\texorpdfstring{renameFile()}{renameFile()}}
{\footnotesize\ttfamily static bool Ogre\+::\+File\+System\+Layer\+::rename\+File (\begin{DoxyParamCaption}\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{oldpath,  }\item[{const \mbox{\hyperlink{namespace_ogre_af73bbdc8bed8a3e6fcd56bb8fa188c45}{Ogre\+::\+String}} \&}]{newpath }\end{DoxyParamCaption})\hspace{0.3cm}{\ttfamily [static]}}



Rename a file. 



The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{_ogre_file_system_layer_8h}{Ogre\+File\+System\+Layer.\+h}}\end{DoxyCompactItemize}
