Jpp
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

◆ ls() [1/2]

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  }

◆ ls() [2/2]

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  }

Member Function Documentation

◆ get()

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  }

The documentation for this struct was generated from the following file:
JSYSTEM::ls::get
void get(JShell &shell, const std::string option="")
add list files.
Definition: JSystemToolkit.hh:332
JSYSTEM::JShell::getline
bool getline(std::string &buffer, const char eol='\n')
Get line of text.
Definition: JShell.hh:137
std
Definition: jaanetDictionary.h:36
JSYSTEM::JShell::getInstance
static JShell & getInstance()
Get reference to unique instance of this class object.
Definition: JShell.hh:76