KVIrc 5.2.6
Developer APIs
KvsObject_file.cpp File Reference
#include "KvsObject_file.h"
#include "kvi_debug.h"
#include "KviLocale.h"
#include "KviError.h"
#include "KviFile.h"
#include "KviFileUtils.h"
#include "KvsObject_memoryBuffer.h"
#include <QStringList>
#include <QTextStream>

Macros

#define CHECK_FILE_IS_OPEN
 
#define mod_num   (sizeof(mod_tbl) / sizeof(mod_tbl[0]))
 

Functions

 if (m_pFile) delete m_pFile
 
 KVSO_CLASS_FUNCTION (file, atEnd)
 
 KVSO_CLASS_FUNCTION (file, close)
 
 KVSO_CLASS_FUNCTION (file, flush)
 
 KVSO_CLASS_FUNCTION (file, getch)
 
 KVSO_CLASS_FUNCTION (file, isOpen)
 
 KVSO_CLASS_FUNCTION (file, name)
 
 KVSO_CLASS_FUNCTION (file, open)
 
 KVSO_CLASS_FUNCTION (file, putch)
 
 KVSO_CLASS_FUNCTION (file, read)
 
 KVSO_CLASS_FUNCTION (file, readBlock)
 
 KVSO_CLASS_FUNCTION (file, readByte)
 
 KVSO_CLASS_FUNCTION (file, readHexBlock)
 
 KVSO_CLASS_FUNCTION (file, readLine)
 
 KVSO_CLASS_FUNCTION (file, resize)
 
 KVSO_CLASS_FUNCTION (file, seek)
 
 KVSO_CLASS_FUNCTION (file, setName)
 
 KVSO_CLASS_FUNCTION (file, size)
 
 KVSO_CLASS_FUNCTION (file, unGetch)
 
 KVSO_CLASS_FUNCTION (file, where)
 
 KVSO_CLASS_FUNCTION (file, write)
 
 KVSO_CLASS_FUNCTION (file, writeBlock)
 
 KVSO_CLASS_FUNCTION (file, writeHexBlock)
 
 KVSO_CLASS_FUNCTION (file, writeLine)
 

Variables

 m_pFile = new KviFile()
 
const QIODevice::OpenMode mod_cod []
 
const char *const mod_tbl []
 

Macro Definition Documentation

◆ CHECK_FILE_IS_OPEN

#define CHECK_FILE_IS_OPEN
Value:
if(!m_pFile->isOpen()) \
{ \
c->warning(__tr2qs_ctx("File is not open!", "objects")); \
return true; \
}
#define __tr2qs_ctx(text, context)
Definition KviLocale.h:223
m_pFile
Definition KvsObject_file.cpp:191

Referenced by KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), KVSO_CLASS_FUNCTION(), and KVSO_CLASS_FUNCTION().

◆ mod_num

#define mod_num   (sizeof(mod_tbl) / sizeof(mod_tbl[0]))

Referenced by KVSO_CLASS_FUNCTION().

Function Documentation

◆ if()

◆ KVSO_CLASS_FUNCTION() [1/23]

KVSO_CLASS_FUNCTION ( file ,
atEnd  )

References CHECK_INTERNAL_POINTER, and m_pFile.

◆ KVSO_CLASS_FUNCTION() [2/23]

KVSO_CLASS_FUNCTION ( file ,
close  )

◆ KVSO_CLASS_FUNCTION() [3/23]

KVSO_CLASS_FUNCTION ( file ,
flush  )

◆ KVSO_CLASS_FUNCTION() [4/23]

KVSO_CLASS_FUNCTION ( file ,
getch  )

◆ KVSO_CLASS_FUNCTION() [5/23]

KVSO_CLASS_FUNCTION ( file ,
isOpen  )

References CHECK_INTERNAL_POINTER, and m_pFile.

◆ KVSO_CLASS_FUNCTION() [6/23]

KVSO_CLASS_FUNCTION ( file ,
name  )

References CHECK_INTERNAL_POINTER, and m_pFile.

◆ KVSO_CLASS_FUNCTION() [7/23]

◆ KVSO_CLASS_FUNCTION() [8/23]

◆ KVSO_CLASS_FUNCTION() [9/23]

◆ KVSO_CLASS_FUNCTION() [10/23]

◆ KVSO_CLASS_FUNCTION() [11/23]

KVSO_CLASS_FUNCTION ( file ,
readByte  )

◆ KVSO_CLASS_FUNCTION() [12/23]

◆ KVSO_CLASS_FUNCTION() [13/23]

KVSO_CLASS_FUNCTION ( file ,
readLine  )

◆ KVSO_CLASS_FUNCTION() [14/23]

◆ KVSO_CLASS_FUNCTION() [15/23]

◆ KVSO_CLASS_FUNCTION() [16/23]

◆ KVSO_CLASS_FUNCTION() [17/23]

KVSO_CLASS_FUNCTION ( file ,
size  )

References CHECK_INTERNAL_POINTER, and m_pFile.

◆ KVSO_CLASS_FUNCTION() [18/23]

◆ KVSO_CLASS_FUNCTION() [19/23]

KVSO_CLASS_FUNCTION ( file ,
where  )

◆ KVSO_CLASS_FUNCTION() [20/23]

◆ KVSO_CLASS_FUNCTION() [21/23]

◆ KVSO_CLASS_FUNCTION() [22/23]

◆ KVSO_CLASS_FUNCTION() [23/23]

Variable Documentation

◆ m_pFile

◆ mod_cod

const QIODevice::OpenMode mod_cod[]
Initial value:
= {
QIODevice::Unbuffered,
QIODevice::ReadOnly,
QIODevice::WriteOnly,
QIODevice::ReadWrite,
QIODevice::Append,
QIODevice::Truncate
}

Referenced by KVSO_CLASS_FUNCTION().

◆ mod_tbl

const char* const mod_tbl[]
Initial value:
= {
"Raw",
"ReadOnly",
"WriteOnly",
"ReadWrite",
"Append",
"Truncate"
}

Referenced by KVSO_CLASS_FUNCTION().