📄 classchm_1_1chmfile.tex
字号:
\hypertarget{classchm_1_1chmfile}{\subsection{chm::chmfile Class Reference}\label{classchm_1_1chmfile}\index{chm::chmfile@{chm::chmfile}}}A chm archive. {\tt \#include $<$chmxx.h$>$}\subsubsection*{Public Types}\begin{CompactItemize}\item enum \hyperlink{classchm_1_1chmfile_s4}{readdir\_\-type} \{ \hyperlink{classchm_1_1chmfile_s4s0}{files} = 1, \hyperlink{classchm_1_1chmfile_s4s1}{dirs} = 2, \hyperlink{classchm_1_1chmfile_s4s2}{special} = 4, \hyperlink{classchm_1_1chmfile_s4s3}{meta} = 8 \}\begin{CompactList}\small\item\em Use a combination of these as argument to the readdir.\item\end{CompactList}\end{CompactItemize}\subsubsection*{Public Methods}\begin{CompactItemize}\item \hyperlink{classchm_1_1chmfile_a0}{chmfile} (const std::string \&path)\begin{CompactList}\small\item\em Construct a new chmfile object from given path.\item\end{CompactList}\item virtual \hyperlink{classchm_1_1chmfile_a1}{$\sim$chmfile} ()\item bool \hyperlink{classchm_1_1chmfile_a2}{is\_\-open} () const\begin{CompactList}\small\item\em Tests whether archive is valid and open.\item\end{CompactList}\item void \hyperlink{classchm_1_1chmfile_a3}{close} ()\begin{CompactList}\small\item\em Close the archive and free resources.\item\end{CompactList}\item \hyperlink{classchm_1_1chmfile_a4}{operator bool} () const\begin{CompactList}\small\item\em Tests whether opened archive is valid.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a5}{read} (const std::string \&path, std::ostream \&out) const\begin{CompactList}\small\item\em Read the entire contents of given file and write to stream out.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a6}{read} (const std::string \&path, std::vector$<$ char $>$ \&out) const\begin{CompactList}\small\item\em Read the entire contents of a file and store inside given vector.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a7}{read} (const std::string \&path, char $\ast$buf, size\_\-t buf\_\-size) const\begin{CompactList}\small\item\em Read buf\_\-size bytes from path and place into buf.\item\end{CompactList}\item std::streamsize \hyperlink{classchm_1_1chmfile_a8}{file\_\-size} (const std::string \&path) const\begin{CompactList}\small\item\em Returns the size of given file inside archive, returns 0 if file does not exist.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a9}{file\_\-exists} (const std::string \&path) const\begin{CompactList}\small\item\em Returns a boolean value whether given file exists inside the archive.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a10}{readdir} (const std::string \&path, std::list$<$ std::string $>$ \&entries, int type=files$|$dirs) const\begin{CompactList}\small\item\em Read entries under given path and append them to the list.\item\end{CompactList}\item std::streambuf $\ast$ \hyperlink{classchm_1_1chmfile_a11}{open} (const std::string \&path, size\_\-t buf\_\-size=1024) const\begin{CompactList}\small\item\em Open given path inside the archive for reading and return a streambuf object.\item\end{CompactList}\item const std::string \& \hyperlink{classchm_1_1chmfile_a12}{get\_\-title} () const\item const std::string \& \hyperlink{classchm_1_1chmfile_a13}{get\_\-home\_\-file} () const\item const std::string \& \hyperlink{classchm_1_1chmfile_a14}{get\_\-generator} () const\item const std::string \& \hyperlink{classchm_1_1chmfile_a15}{get\_\-index\_\-file} () const\item const std::string \& \hyperlink{classchm_1_1chmfile_a16}{get\_\-topics\_\-file} () const\item const std::string \& \hyperlink{classchm_1_1chmfile_a17}{get\_\-path} () const\item const \hyperlink{structchm_1_1chm__topics__tree}{chm\_\-topics\_\-tree} $\ast$ \hyperlink{classchm_1_1chmfile_a18}{get\_\-topics\_\-tree} () const\begin{CompactList}\small\item\em Gets the topics tree.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a19}{search\_\-index} (const std::string \&txt, std::list$<$ \hyperlink{structchm_1_1chm__search__match}{chm\_\-search\_\-match} $>$ \&found, bool whole\_\-words=true, bool titles\_\-only=true) const\begin{CompactList}\small\item\em Search the archive for given keyword and return found entries in found.\item\end{CompactList}\item bool \hyperlink{classchm_1_1chmfile_a20}{cache} (const std::string \&path)\begin{CompactList}\small\item\em Cache given file for \_\-fast\_\- access inside memory.\item\end{CompactList}\item void \hyperlink{classchm_1_1chmfile_a21}{cache\_\-search\_\-database} ()\begin{CompactList}\small\item\em Cache all metadata that is required to perform fast searches inside the index.\item\end{CompactList}\end{CompactItemize}\subsubsection{Detailed Description}A chm archive.Definition at line 54 of file chmxx.h.\subsubsection{Member Enumeration Documentation}\hypertarget{classchm_1_1chmfile_s4}{\index{chm::chmfile@{chm::chmfile}!readdir_type@{readdir\_\-type}}\index{readdir_type@{readdir\_\-type}!chm::chmfile@{chm::chmfile}}\paragraph[readdir\_\-type]{\setlength{\rightskip}{0pt plus 5cm}enum chm::chmfile::readdir\_\-type}\hfill}\label{classchm_1_1chmfile_s4}Use a combination of these as argument to the readdir.\begin{Desc}\item[Enumeration values: ]\par\begin{description}\index{files@{files}!chm::chmfile@{chm::chmfile}}\index{chm::chmfile@{chm::chmfile}!files@{files}}\item[{\em \hypertarget{classchm_1_1chmfile_s4s0}{{\em files}}\label{classchm_1_1chmfile_s4s0}}]\index{dirs@{dirs}!chm::chmfile@{chm::chmfile}}\index{chm::chmfile@{chm::chmfile}!dirs@{dirs}}\item[{\em \hypertarget{classchm_1_1chmfile_s4s1}{{\em dirs}}\label{classchm_1_1chmfile_s4s1}}]\index{special@{special}!chm::chmfile@{chm::chmfile}}\index{chm::chmfile@{chm::chmfile}!special@{special}}\item[{\em \hypertarget{classchm_1_1chmfile_s4s2}{{\em special}}\label{classchm_1_1chmfile_s4s2}}]\index{meta@{meta}!chm::chmfile@{chm::chmfile}}\index{chm::chmfile@{chm::chmfile}!meta@{meta}}\item[{\em \hypertarget{classchm_1_1chmfile_s4s3}{{\em meta}}\label{classchm_1_1chmfile_s4s3}}]\end{description}\end{Desc}Definition at line 86 of file chmxx.h.\subsubsection{Constructor \& Destructor Documentation}\hypertarget{classchm_1_1chmfile_a0}{\index{chm::chmfile@{chm::chmfile}!chmfile@{chmfile}}\index{chmfile@{chmfile}!chm::chmfile@{chm::chmfile}}\paragraph[chmfile]{\setlength{\rightskip}{0pt plus 5cm}chm::chmfile::chmfile (const std::string \& {\em path})}\hfill}\label{classchm_1_1chmfile_a0}Construct a new chmfile object from given path.\hypertarget{classchm_1_1chmfile_a1}{\index{chm::chmfile@{chm::chmfile}!~chmfile@{$\sim$chmfile}}\index{~chmfile@{$\sim$chmfile}!chm::chmfile@{chm::chmfile}}\paragraph[$\sim$chmfile]{\setlength{\rightskip}{0pt plus 5cm}virtual chm::chmfile::$\sim$chmfile ()\hspace{0.3cm}{\tt \mbox{[}virtual\mbox{]}}}\hfill}\label{classchm_1_1chmfile_a1}\subsubsection{Member Function Documentation}\hypertarget{classchm_1_1chmfile_a20}{\index{chm::chmfile@{chm::chmfile}!cache@{cache}}\index{cache@{cache}!chm::chmfile@{chm::chmfile}}\paragraph[cache]{\setlength{\rightskip}{0pt plus 5cm}bool chm::chmfile::cache (const std::string \& {\em path})}\hfill}\label{classchm_1_1chmfile_a20}Cache given file for \_\-fast\_\- access inside memory.All streams opened for that file will be memory cached. I know this caching business is a bit superfluous. It's not all good too - if you start unreading stuff using the stream the cache will be changed. \hypertarget{classchm_1_1chmfile_a21}{\index{chm::chmfile@{chm::chmfile}!cache_search_database@{cache\_\-search\_\-database}}\index{cache_search_database@{cache\_\-search\_\-database}!chm::chmfile@{chm::chmfile}}\paragraph[cache\_\-search\_\-database]{\setlength{\rightskip}{0pt plus 5cm}void chm::chmfile::cache\_\-search\_\-database ()}\hfill}\label{classchm_1_1chmfile_a21}Cache all metadata that is required to perform fast searches inside the index.\hypertarget{classchm_1_1chmfile_a3}{\index{chm::chmfile@{chm::chmfile}!close@{close}}\index{close@{close}!chm::chmfile@{chm::chmfile}}\paragraph[close]{\setlength{\rightskip}{0pt plus 5cm}void chm::chmfile::close ()}\hfill}\label{classchm_1_1chmfile_a3}Close the archive and free resources.\hypertarget{classchm_1_1chmfile_a9}{\index{chm::chmfile@{chm::chmfile}!file_exists@{file\_\-exists}}\index{file_exists@{file\_\-exists}!chm::chmfile@{chm::chmfile}}\paragraph[file\_\-exists]{\setlength{\rightskip}{0pt plus 5cm}bool chm::chmfile::file\_\-exists (const std::string \& {\em path}) const}\hfill}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -