Sophie

Sophie

distrib > Mageia > 7 > armv7hl > media > core-updates > by-pkgid > 94774a05d4f99367afd97b8b4adf565d > files > 938

libfilezilla-devel-0.19.3-1.mga7.armv7hl.rpm

\hypertarget{classfz_1_1process}{}\section{process Class Reference}
\label{classfz_1_1process}\index{process@{process}}


The process class manages an asynchronous process with redirected IO.  




{\ttfamily \#include $<$process.\+hpp$>$}

\subsection*{Public Member Functions}
\begin{DoxyCompactItemize}
\item 
\mbox{\Hypertarget{classfz_1_1process_a1c7fbaf7eabf18a2a724100403fdde54}\label{classfz_1_1process_a1c7fbaf7eabf18a2a724100403fdde54}} 
{\bfseries process} (\mbox{\hyperlink{classfz_1_1process}{process}} const \&)=delete
\item 
\mbox{\Hypertarget{classfz_1_1process_af7cab9bbde4cf43b8c06c9333d2bcebf}\label{classfz_1_1process_af7cab9bbde4cf43b8c06c9333d2bcebf}} 
\mbox{\hyperlink{classfz_1_1process}{process}} \& {\bfseries operator=} (\mbox{\hyperlink{classfz_1_1process}{process}} const \&)=delete
\item 
bool \mbox{\hyperlink{classfz_1_1process_a115d96e600e24af03f50dfa02f41f7cf}{spawn}} (\mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}} const \&cmd, std\+::vector$<$ \mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}} $>$ const \&args=std\+::vector$<$ \mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}} $>$())
\begin{DoxyCompactList}\small\item\em Start the process. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classfz_1_1process_a1b0cbbec974c5074951c857e23d8da77}\label{classfz_1_1process_a1b0cbbec974c5074951c857e23d8da77}} 
bool {\bfseries spawn} (std\+::vector$<$ \mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}} $>$ const \&command\+\_\+with\+\_\+args)
\item 
void \mbox{\hyperlink{classfz_1_1process_aae9d52caad9fb2892deeb25596cfd2ab}{kill}} ()
\begin{DoxyCompactList}\small\item\em Stops the spawned process. \end{DoxyCompactList}\item 
int \mbox{\hyperlink{classfz_1_1process_a22ad3ef13eba91f03285364cf3610df8}{read}} (char $\ast$\mbox{\hyperlink{classfz_1_1buffer}{buffer}}, unsigned int len)
\begin{DoxyCompactList}\small\item\em Read data from process. \end{DoxyCompactList}\item 
bool \mbox{\hyperlink{classfz_1_1process_a55142f6c2dc7a599dfc29eb7d2433b62}{write}} (char const $\ast$\mbox{\hyperlink{classfz_1_1buffer}{buffer}}, unsigned int len)
\begin{DoxyCompactList}\small\item\em Write data data process. \end{DoxyCompactList}\item 
\mbox{\Hypertarget{classfz_1_1process_a5538d1e5603c2d2ab6401dee241a7533}\label{classfz_1_1process_a5538d1e5603c2d2ab6401dee241a7533}} 
bool {\bfseries write} (std\+::string\+\_\+view const \&s)
\end{DoxyCompactItemize}


\subsection{Detailed Description}
The process class manages an asynchronous process with redirected IO. 

No console window is being created.

To use, spawn the process and, since it\textquotesingle{}s blocking, call read from a different thread. \begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{process_8cpp-example}{process.\+cpp}}.\end{Desc}


\subsection{Member Function Documentation}
\mbox{\Hypertarget{classfz_1_1process_aae9d52caad9fb2892deeb25596cfd2ab}\label{classfz_1_1process_aae9d52caad9fb2892deeb25596cfd2ab}} 
\index{process@{process}!kill@{kill}}
\index{kill@{kill}!process@{process}}
\subsubsection{\texorpdfstring{kill()}{kill()}}
{\footnotesize\ttfamily void kill (\begin{DoxyParamCaption}{ }\end{DoxyParamCaption})}



Stops the spawned process. 

This function doesn\textquotesingle{}t actually kill the process, it merely closes the pipes.

Blocks until the process has quit. \mbox{\Hypertarget{classfz_1_1process_a22ad3ef13eba91f03285364cf3610df8}\label{classfz_1_1process_a22ad3ef13eba91f03285364cf3610df8}} 
\index{process@{process}!read@{read}}
\index{read@{read}!process@{process}}
\subsubsection{\texorpdfstring{read()}{read()}}
{\footnotesize\ttfamily int read (\begin{DoxyParamCaption}\item[{char $\ast$}]{buffer,  }\item[{unsigned int}]{len }\end{DoxyParamCaption})}



Read data from process. 

This function blocks

\begin{DoxyReturn}{Returns}
$>$0 Number of octets read, can be less than requested 

0 on E\+OF 

-\/1 on error. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{process_8cpp-example}{process.\+cpp}}.\end{Desc}
\mbox{\Hypertarget{classfz_1_1process_a115d96e600e24af03f50dfa02f41f7cf}\label{classfz_1_1process_a115d96e600e24af03f50dfa02f41f7cf}} 
\index{process@{process}!spawn@{spawn}}
\index{spawn@{spawn}!process@{process}}
\subsubsection{\texorpdfstring{spawn()}{spawn()}}
{\footnotesize\ttfamily bool spawn (\begin{DoxyParamCaption}\item[{\mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}} const \&}]{cmd,  }\item[{std\+::vector$<$ \mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}} $>$ const \&}]{args = {\ttfamily std\+:\+:vector$<$~\mbox{\hyperlink{namespacefz_a79dcecd35ee9a55ae1a5afe76d23e9e5}{native\+\_\+string}}~$>$()} }\end{DoxyParamCaption})}



Start the process. 

This function takes care of properly quoting and escaping the the program\textquotesingle{}s path and its arguments. Fails if process has already been spawned.


\begin{DoxyParams}{Parameters}
{\em cmd} & The path of the program to execute \\
\hline
{\em args} & The command-\/line arguments for the process.\\
\hline
\end{DoxyParams}
\begin{DoxyNote}{Note}
May return {\ttfamily true} even if the process cannot be started. In that case, trying to read from the process will fail with an error or E\+OF. 
\end{DoxyNote}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{process_8cpp-example}{process.\+cpp}}.\end{Desc}
\mbox{\Hypertarget{classfz_1_1process_a55142f6c2dc7a599dfc29eb7d2433b62}\label{classfz_1_1process_a55142f6c2dc7a599dfc29eb7d2433b62}} 
\index{process@{process}!write@{write}}
\index{write@{write}!process@{process}}
\subsubsection{\texorpdfstring{write()}{write()}}
{\footnotesize\ttfamily bool write (\begin{DoxyParamCaption}\item[{char const $\ast$}]{buffer,  }\item[{unsigned int}]{len }\end{DoxyParamCaption})}



Write data data process. 

This function blocks

\begin{DoxyReturn}{Returns}
true if all octets have been written. 

false on error. 
\end{DoxyReturn}
\begin{Desc}
\item[Examples]\par
\mbox{\hyperlink{process_8cpp-example}{process.\+cpp}}.\end{Desc}


The documentation for this class was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{process_8hpp}{process.\+hpp}}\end{DoxyCompactItemize}