\doxysection{include/sphinxbase/filename.h File Reference}
\label{filename_8h}\index{include/sphinxbase/filename.h@{include/sphinxbase/filename.h}}


File names related operation.  


{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\newline
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\newline
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ path2basename} (const char $\ast$path, char $\ast$base)
\begin{DoxyCompactList}\small\item\em Strip off leading path components from the given path and copy the base into base. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ path2dirname} (const char $\ast$path, char $\ast$dir)
\begin{DoxyCompactList}\small\item\em Strip off filename from the given path and copy the directory name into dir Caller must have allocated dir (hint\+: it\textquotesingle{}s always shorter than path). \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT void \textbf{ strip\+\_\+fileext} (const char $\ast$file, char $\ast$root)
\begin{DoxyCompactList}\small\item\em Strip off the smallest trailing file-\/extension suffix and copy the rest into the given root argument. \end{DoxyCompactList}\item 
SPHINXBASE\+\_\+\+EXPORT int \textbf{ path\+\_\+is\+\_\+absolute} (const char $\ast$file)
\begin{DoxyCompactList}\small\item\em Test whether a pathname is absolute for the current OS. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
File names related operation. 



Definition in file \textbf{ filename.\+h}.



\doxysubsection{Function Documentation}
\label{filename_8h_ad8a88d52ec0af498bc126a90871b2efe} 
\index{filename.h@{filename.h}!path2basename@{path2basename}}
\index{path2basename@{path2basename}!filename.h@{filename.h}}
\doxysubsubsection{path2basename()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void path2basename (\begin{DoxyParamCaption}\item[{const char $\ast$}]{path,  }\item[{char $\ast$}]{base }\end{DoxyParamCaption})}



Strip off leading path components from the given path and copy the base into base. 

Caller must have allocated base (hint\+: it\textquotesingle{}s always shorter than path). 

Definition at line \textbf{ 75} of file \textbf{ filename.\+c}.



References \textbf{ path2basename()}.



Referenced by \textbf{ path2basename()}.

\label{filename_8h_a678be92ddb74695f26a9e4f527b073b0} 
\index{filename.h@{filename.h}!path2dirname@{path2dirname}}
\index{path2dirname@{path2dirname}!filename.h@{filename.h}}
\doxysubsubsection{path2dirname()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void path2dirname (\begin{DoxyParamCaption}\item[{const char $\ast$}]{path,  }\item[{char $\ast$}]{dir }\end{DoxyParamCaption})}



Strip off filename from the given path and copy the directory name into dir Caller must have allocated dir (hint\+: it\textquotesingle{}s always shorter than path). 



Definition at line \textbf{ 90} of file \textbf{ filename.\+c}.



References \textbf{ path2dirname()}.



Referenced by \textbf{ path2dirname()}.

\label{filename_8h_ac59add2db73b33e81b354de114268e7a} 
\index{filename.h@{filename.h}!path\_is\_absolute@{path\_is\_absolute}}
\index{path\_is\_absolute@{path\_is\_absolute}!filename.h@{filename.h}}
\doxysubsubsection{path\_is\_absolute()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT int path\+\_\+is\+\_\+absolute (\begin{DoxyParamCaption}\item[{const char $\ast$}]{file }\end{DoxyParamCaption})}



Test whether a pathname is absolute for the current OS. 



Definition at line \textbf{ 126} of file \textbf{ filename.\+c}.



References \textbf{ path\+\_\+is\+\_\+absolute()}.



Referenced by \textbf{ ngram\+\_\+model\+\_\+set\+\_\+read()}, and \textbf{ path\+\_\+is\+\_\+absolute()}.

\label{filename_8h_ad40b54252813d276ff2ebb097b242657} 
\index{filename.h@{filename.h}!strip\_fileext@{strip\_fileext}}
\index{strip\_fileext@{strip\_fileext}!filename.h@{filename.h}}
\doxysubsubsection{strip\_fileext()}
{\footnotesize\ttfamily SPHINXBASE\+\_\+\+EXPORT void strip\+\_\+fileext (\begin{DoxyParamCaption}\item[{const char $\ast$}]{file,  }\item[{char $\ast$}]{root }\end{DoxyParamCaption})}



Strip off the smallest trailing file-\/extension suffix and copy the rest into the given root argument. 

Caller must have allocated root. 

Definition at line \textbf{ 111} of file \textbf{ filename.\+c}.



References \textbf{ strip\+\_\+fileext()}.



Referenced by \textbf{ strip\+\_\+fileext()}.

