18.03.2013 - Bug fixes, add in/out speed diagnostic to PIProtocol, fixed PIConsole tab switch segfault, PIObject EVENT / EVENT_HANDLER mechanism update - new EVENT macros that use EVENT_HANDLER with raiseEvent implementation.
This allow compile check event for CONNECT and use EVENT as CONNECT target, also raise event now is simple execute EVENT function.
This commit is contained in:
23
pidir.h
Executable file → Normal file
23
pidir.h
Executable file → Normal file
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
PIP - Platform Independent Primitives
|
||||
Directory
|
||||
Copyright (C) 2012 Ivan Pelipenko peri4ko@gmail.com
|
||||
Copyright (C) 2013 Ivan Pelipenko peri4ko@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -21,6 +21,7 @@
|
||||
#define PIDIR_H
|
||||
|
||||
#include "pifile.h"
|
||||
#include "pistring.h"
|
||||
#ifndef WINDOWS
|
||||
#include <sys/dir.h>
|
||||
#include <sys/stat.h>
|
||||
@@ -43,23 +44,23 @@ public:
|
||||
|
||||
bool isDir() const {return (mode & S_IFDIR);}
|
||||
bool isFile() const {return (mode & S_IFREG);}
|
||||
bool isSymLink() const {return (mode & S_IFLNK);}
|
||||
bool isBlkDevice() const {return (mode & S_IFBLK);}
|
||||
bool isChrDevice() const {return (mode & S_IFCHR);}
|
||||
bool isSymbolicLink() const {return (mode & S_IFLNK);}
|
||||
bool isBlockDevice() const {return (mode & S_IFBLK);}
|
||||
bool isCharacterDevice() const {return (mode & S_IFCHR);}
|
||||
bool isSocket() const {return (mode & S_IFSOCK);}
|
||||
};
|
||||
|
||||
inline const bool isExists() {return (dir_ != 0);}
|
||||
inline const bool isAbsolute() {if (path_.size() == 0) return false; return (path_[0] == separator);}
|
||||
inline PIString path() {return PIString(path_);}
|
||||
PIDir & cleanPath();
|
||||
inline PIDir cleanedPath() {PIDir d(path_); d.cleanPath(); return d;}
|
||||
const bool isExists() {return (dir_ != 0);}
|
||||
const bool isAbsolute() {if (path_.size() == 0) return false; return (path_[0] == separator);}
|
||||
PIString path() {return PIString(path_);}
|
||||
PIDir & cleanPath();
|
||||
PIDir cleanedPath() {PIDir d(path_); d.cleanPath(); return d;}
|
||||
PIString absolutePath();
|
||||
bool mkDir(bool withParents = true);
|
||||
PIVector<DirEntry> entries();
|
||||
|
||||
PIDir & cd(const PIString & path);
|
||||
inline PIDir & up() {return cd("..");}
|
||||
PIDir & cd(const PIString & path);
|
||||
PIDir & up() {return cd("..");}
|
||||
|
||||
bool operator ==(const PIDir & d) const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user