30.11.2013 - New PICollection namespace, Android support, my own PIVector implementation

This commit is contained in:
peri4
2013-11-30 19:34:53 +04:00
parent ec5530053a
commit f50891b376
64 changed files with 5466 additions and 3392 deletions

View File

@@ -20,6 +20,27 @@
#include "pifile.h"
/*! \class PIFile
* \brief Local file
*
* \section PIFile_sec0 Synopsis
* This class provide access to local file. You can manipulate
* binary content or use this class as text stream. To binary
* access there are function \a read(), \a write(), and many
* \a writeBinary() functions. For write variables to file in
* their text representation threr are many "<<" operators.
*
* \section PIFile_sec1 Position
* Each opened file has a read/write position - logical position
* in the file content you read from or you write to. You can
* find out current position with function \a pos(). Function
* \a seek(llong position) move position to position "position",
* \a seekToBegin() move position to the begin of file,
* \a seekToEnd() move position to the end of file.
*
*/
bool PIFile::openDevice() {
if (opened_) close();
if (path_.isEmpty()) return false;
@@ -94,11 +115,11 @@ llong PIFile::size() {
}
void PIFile::resize(llong new_size, char fill_) {
void PIFile::resize(llong new_size, uchar fill_) {
llong ds = new_size - size();
if (ds == 0) return;
if (ds > 0) {
char * buff = new char[ds];
uchar * buff = new uchar[ds];
memset(buff, fill_, ds);
write(buff, ds);
delete[] buff;