Skip to content

Commit

Permalink
[Utils] Declare const members as const.
Browse files Browse the repository at this point in the history
  • Loading branch information
abh3 committed Dec 6, 2021
1 parent ffc4c6b commit 3701651
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
12 changes: 6 additions & 6 deletions src/XrdOuc/XrdOucProg.cc
Expand Up @@ -106,7 +106,7 @@ int XrdOucProg::Feed(const char *data[], const int dlen[])
theRC = Run(strmP, argV, argC)

int XrdOucProg::Run(XrdOucStream *Sp, const char *argV[], int argC,
const char *envV[])
const char *envV[]) const
{
char **myArgs;
int rc, totArgs = numArgs + argC;
Expand Down Expand Up @@ -153,7 +153,7 @@ int XrdOucProg::Run(XrdOucStream *Sp, const char *argV[], int argC,

/******************************************************************************/

int XrdOucProg::Run(const char *argV[], int argC, const char *envV[])
int XrdOucProg::Run(const char *argV[], int argC, const char *envV[]) const
{
XrdOucStream cmd;
char *lp;
Expand All @@ -177,7 +177,7 @@ int XrdOucProg::Run(const char *argV[], int argC, const char *envV[])
/******************************************************************************/

int XrdOucProg::Run(XrdOucStream *Sp, const char *arg1, const char *arg2,
const char *arg3, const char *arg4)
const char *arg3, const char *arg4) const
{
int rc;

Expand All @@ -190,7 +190,7 @@ int XrdOucProg::Run(XrdOucStream *Sp, const char *arg1, const char *arg2,
/******************************************************************************/

int XrdOucProg::Run(const char *arg1, const char *arg2,
const char *arg3, const char *arg4)
const char *arg3, const char *arg4) const
{
XrdOucStream cmd;
char *lp;
Expand All @@ -215,7 +215,7 @@ int XrdOucProg::Run(const char *arg1, const char *arg2,

int XrdOucProg::Run(char *outBuff, int outBsz,
const char *arg1, const char *arg2,
const char *arg3, const char *arg4)
const char *arg3, const char *arg4) const
{
XrdOucStream cmd;
char *lp, *tp;
Expand Down Expand Up @@ -254,7 +254,7 @@ int XrdOucProg::Run(char *outBuff, int outBsz,
/* R u n D o n e */
/******************************************************************************/

int XrdOucProg::RunDone(XrdOucStream &cmd)
int XrdOucProg::RunDone(XrdOucStream &cmd) const
{
int rc;

Expand Down
18 changes: 11 additions & 7 deletions src/XrdOuc/XrdOucProg.hh
Expand Up @@ -65,7 +65,11 @@ int Feed(const char *data) {return Feed(data, (int)strlen(data));}
// getStream() returns the stream created by Start(). Use the object to get
// lines written by the started program.
//
XrdOucStream *getStream() {return myStream;}
XrdOucStream *getStream() const {return myStream;}

// Return true if this program is a local in-line executable.
//
bool isLocal() {return myProc != 0;}

// Run executes the command that was passed via Setup(). You may pass
// additional arguments to be appended to the existing ones. The
Expand All @@ -74,28 +78,28 @@ XrdOucStream *getStream() {return myStream;}
// When using the form without a stream pointer, command output is thrown away.
//
int Run(XrdOucStream *Sp, const char *argV[], int argc=0,
const char *envV[]=0);
const char *envV[]=0) const;

int Run(const char *argV[], int argC, const char *envV[]=0);
int Run(const char *argV[], int argC, const char *envV[]=0) const;

// Run executes the command that was passed via Setup(). You may pass
// up to four additional arguments that will be added to the end of any
// existing arguments. The ending status code of the program is returned.
//
int Run(XrdOucStream *Sp, const char *arg1=0, const char *arg2=0,
const char *arg3=0, const char *arg4=0);
const char *arg3=0, const char *arg4=0) const;

int Run(const char *arg1=0, const char *arg2=0,
const char *arg3=0, const char *arg4=0);
const char *arg3=0, const char *arg4=0) const;

int Run(char *outBuff, int outBsz,
const char *arg1=0, const char *arg2=0,
const char *arg3=0, const char *arg4=0);
const char *arg3=0, const char *arg4=0) const;

// RunDone should be called to drain the output stream and get the ending
// status of the running process.
//
int RunDone(XrdOucStream &cmd);
int RunDone(XrdOucStream &cmd) const;

// Start executes the command that was passed via Setup(). The started
// program is expected to linger so that you can send directives to it
Expand Down

0 comments on commit 3701651

Please sign in to comment.