Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
File Class Reference

File holds and manipulates files on file systems. More...

Inheritance diagram for File:
Directory FileSystem

Public Member Functions

string getName ()
 Returns the filename of the file. More...
 
FilePermission getPermission ()
 Returns the permissions of the file. More...
 
bool isExecutable ()
 Returns true if the file is executable, otherwise false. More...
 
bool isWritable ()
 Returns true if the file is writable, otherwise false. More...
 
bool isReadable ()
 Returns true if the file is readable, otherwise false. More...
 
bool isDirectory ()
 Returns true if the file is a directory, otherwise false. More...
 
int getSize ()
 Returns the filesize of the file. More...
 
Directory getParent ()
 Returns the parent directory. More...
 
string getAbsPath ()
 Returns absolute path of the File object. More...
 
void setTextContent (string, bool)
 set the content of the File object. More...
 
FileContent getContent (bool)
 Returns the file content of the File. More...
 

Detailed Description

File holds and manipulates files on file systems.

Member Function Documentation

◆ getAbsPath()

string File::getAbsPath ( )

Returns absolute path of the File object.

Returns
string, absolute path of the File object.

◆ getContent()

FileContent File::getContent ( bool  )

Returns the file content of the File.

Parameters
bCheckPermission,trueif check the permission of the file, otherwise false.
Returns
FileContent, the file content of the File.

◆ getName()

string File::getName ( )

Returns the filename of the file.

Returns
string, the filename of the file.

◆ getParent()

Directory File::getParent ( )

Returns the parent directory.

Returns
Directory, the parent directory.

◆ getPermission()

FilePermission File::getPermission ( )

Returns the permissions of the file.

Returns
enum<FilePermission>, the permissions of the file. Permissions: eExecute = 1, eWrite = 2, eRead = 4

◆ getSize()

int File::getSize ( )

Returns the filesize of the file.

Returns
int, the filesize of the file.

◆ isDirectory()

bool File::isDirectory ( )

Returns true if the file is a directory, otherwise false.

Returns
bool, true if the file is a directory, otherwise false.

◆ isExecutable()

bool File::isExecutable ( )

Returns true if the file is executable, otherwise false.

Returns
bool, true if the file is executable, otherwise false.

◆ isReadable()

bool File::isReadable ( )

Returns true if the file is readable, otherwise false.

Returns
bool, true if the file is readable, otherwise false.

◆ isWritable()

bool File::isWritable ( )

Returns true if the file is writable, otherwise false.

Returns
bool, true if the file is writable, otherwise false.

◆ setTextContent()

void File::setTextContent ( string  ,
bool   
)

set the content of the File object.

Parameters
content,thecontent string to set to the File.
bCheckPermission,trueif check the permission of the file, otherwise false.

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