Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
JSYSTEM::ls Struct Reference

Auxiliary class to list files. More...

#include <JSystemToolkit.hh>

Inheritance diagram for JSYSTEM::ls:
std::vector< std::string >

Public Member Functions

 ls (JShell &shell, const std::string &option="")
 Constructor. More...
 
 ls (const std::string &option="")
 Constructor. More...
 
void get (JShell &shell, const std::string option="")
 add list files. More...
 

Detailed Description

Auxiliary class to list files.

Definition at line 300 of file JSystemToolkit.hh.

Constructor & Destructor Documentation

JSYSTEM::ls::ls ( JShell shell,
const std::string &  option = "" 
)
inline

Constructor.

Parameters
shellshell interface
optionoption

Definition at line 309 of file JSystemToolkit.hh.

310  {
311  get(shell, option);
312  }
JSYSTEM::ls::ls ( const std::string &  option = "")
inline

Constructor.

Parameters
optionoption

Definition at line 320 of file JSystemToolkit.hh.

321  {
322  get(JShell::getInstance(), option);
323  }
static JShell & getInstance()
Get reference to unique instance of this class object.
Definition: JShell.hh:76

Member Function Documentation

void JSYSTEM::ls::get ( JShell shell,
const std::string  option = "" 
)
inline

add list files.

Parameters
shellshell interface
optionoption

Definition at line 332 of file JSystemToolkit.hh.

333  {
334  using namespace std;
335 
336  string buffer = "ls";
337 
338  if (!option.empty()) {
339  buffer += " " + option;
340  }
341 
342  shell << buffer << endl;
343 
344  while (shell.getline(buffer)) {
345  push_back(buffer);
346  }
347  }
bool getline(std::string &buffer, const char eol= '\n')
Get line of text.
Definition: JShell.hh:137

The documentation for this struct was generated from the following file: