AppUtil.h File Reference

#include <time.h>
#include <libintl.h>
#include <string.h>
#include <cstdarg>
#include <cstdio>
#include <fstream>
#include <sstream>
#include <locale>
#include <string>
#include <list>
#include <map>

Go to the source code of this file.

Namespaces

namespace  storage

Defines

#define y2debug(format,...)   logMsgVaArgs(storage::DEBUG, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
#define y2milestone(format,...)   logMsgVaArgs(storage::MILESTONE, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
#define y2warning(format,...)   logMsgVaArgs(storage::WARNING, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
#define y2error(format,...)   logMsgVaArgs(storage::ERROR, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)
#define y2deb(op)   y2log_op(storage::DEBUG, __FILE__, __LINE__, __FUNCTION__, op)
#define y2mil(op)   y2log_op(storage::MILESTONE, __FILE__, __LINE__, __FUNCTION__, op)
#define y2war(op)   y2log_op(storage::WARNING, __FILE__, __LINE__, __FUNCTION__, op)
#define y2err(op)   y2log_op(storage::ERROR, __FILE__, __LINE__, __FUNCTION__, op)
#define y2log_op(level, file, line, function, op)

Enumerations

enum  storage::LogLevel { storage::DEBUG, storage::MILESTONE, storage::WARNING, storage::ERROR }

Functions

bool storage::searchFile (AsciiFile &File_Cr, string Pat_Cv, string &Line_Cr)
bool storage::searchFile (AsciiFile &File_Cr, string Pat_Cv, string &Line_Cr, int &LineNr_ir)
void storage::createPath (string Path_Cv)
bool storage::checkNormalFile (string Path_Cv)
bool storage::checkDir (string Path_Cv)
string storage::dupDash (const string &s)
string storage::extractNthWord (int Num_iv, const string &Line_Cv, bool GetRest_bi)
list< string > storage::splitString (const string &s, const string &delChars, bool multipleDelim, bool skipEmpty, const string &quotes)
string storage::mergeString (const list< string > &l, const string &del)
map< string, string > storage::makeMap (const list< string > &l, const string &delim, const string &removeSur)
void storage::getUdevMap (const char *path, map< string, list< string >> &m)
void storage::getRevUdevMap (const char *path, map< string, string > &m)
string storage::normalizeDevice (const string &dev)
void storage::normalizeDevice (string &dev)
string storage::undevDevice (const string &dev)
void storage::undevDevice (string &dev)
bool storage::isNfsDev (const string &dev)
unsigned storage::getMajorDevices (const string &driver)
template<class StreamType>
void storage::classic (StreamType &stream)
void storage::createLogger (const string &lcomponent, const string &name, const string &logpath, const string &logfile)
bool storage::testLogLevel (LogLevel level)
void storage::logMsg (LogLevel level, const char *file, unsigned line, const char *func, const string &str)
void storage::logMsgVaArgs (LogLevel level, const char *file, unsigned line, const char *func, const char *format,...)
void storage::prepareLogStream (std::ostringstream &s)
string storage::sformat (const char *format,...)
string storage::byteToHumanString (unsigned long long size, bool classic, int precision, bool omit_zeroes)
bool storage::humanStringToByte (const string &str, bool classic, unsigned long long &size)
const char * storage::_ (const char *msgid)
const char * storage::_ (const char *msgid, const char *msgid_plural, unsigned long int n)


Define Documentation

#define y2deb ( op   )     y2log_op(storage::DEBUG, __FILE__, __LINE__, __FUNCTION__, op)

Referenced by storage::SystemCmd::addLine(), storage::Container::Container(), storage::Dasd::Dasd(), storage::Disk::Disk(), storage::Dm::Dm(), storage::DmCo::DmCo(), storage::DmPart::DmPart(), storage::DmPartCo::DmPartCo(), storage::SystemCmd::doExecute(), storage::SystemCmd::getUntilEOF(), storage::Disk::getUnusedSpace(), storage::Lock::Lock(), storage::Loop::Loop(), storage::LoopCo::LoopCo(), storage::LvmLv::LvmLv(), storage::LvmVg::LvmVg(), storage::Md::Md(), storage::MdCo::MdCo(), storage::Nfs::Nfs(), storage::NfsCo::NfsCo(), storage::SystemCmd::numLines(), storage::Volume::operator=(), storage::Partition::operator=(), storage::Nfs::operator=(), storage::Md::operator=(), storage::LvmLv::operator=(), storage::Loop::operator=(), storage::Dmraid::operator=(), storage::DmPart::operator=(), storage::Dmmultipath::operator=(), storage::Dm::operator=(), storage::Disk::operator=(), storage::Dasd::operator=(), storage::Container::operator=(), storage::Partition::Partition(), storage::PeContainer::PeContainer(), storage::Volume::Volume(), storage::Container::~Container(), storage::Dasd::~Dasd(), storage::Disk::~Disk(), storage::Dm::~Dm(), storage::DmCo::~DmCo(), storage::Dmmultipath::~Dmmultipath(), storage::DmmultipathCo::~DmmultipathCo(), storage::DmPart::~DmPart(), storage::DmPartCo::~DmPartCo(), storage::Dmraid::~Dmraid(), storage::DmraidCo::~DmraidCo(), storage::Loop::~Loop(), storage::LoopCo::~LoopCo(), storage::LvmLv::~LvmLv(), storage::LvmVg::~LvmVg(), storage::Md::~Md(), storage::MdCo::~MdCo(), storage::Nfs::~Nfs(), storage::NfsCo::~NfsCo(), storage::Partition::~Partition(), storage::PeContainer::~PeContainer(), and storage::Volume::~Volume().

#define y2debug ( format,
...   )     logMsgVaArgs(storage::DEBUG, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)

#define y2err ( op   )     y2log_op(storage::ERROR, __FILE__, __LINE__, __FUNCTION__, op)

#define y2error ( format,
...   )     logMsgVaArgs(storage::ERROR, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)

#define y2log_op ( level,
file,
line,
function,
op   ) 

Value:

do {                                                            \
        if (storage::testLogLevel(level))                               \
        {                                                               \
            std::ostringstream __buf;                                   \
            storage::prepareLogStream(__buf);                           \
            __buf << op;                                                \
            storage::logMsg(level, file, line, function, __buf.str());  \
        }                                                               \
    } while (0)

#define y2mil ( op   )     y2log_op(storage::MILESTONE, __FILE__, __LINE__, __FUNCTION__, op)

Referenced by storage::LvmVg::activate(), storage::DmmultipathCo::activate(), storage::Storage::activateHld(), storage::Storage::activateMultipath(), storage::EtcFstab::addEntry(), storage::SystemCmd::addLine(), storage::Partition::addUdevData(), storage::Storage::autodetectDisks(), storage::Disk::availablePartNumber(), storage::Volume::canResize(), storage::Partition::changeId(), storage::MdCo::changeMdChunk(), storage::MdCo::changeMdParity(), storage::MdCo::changeMdType(), storage::Volume::changeMountBy(), storage::DmPartCo::changePartitionArea(), storage::Disk::changePartitionArea(), storage::DmPartCo::changePartitionId(), storage::Disk::changePartitionId(), storage::PeContainer::checkCreateConstraints(), storage::Md::checkDevices(), storage::Dasd::checkFdasdOutput(), storage::MdCo::checkMd(), storage::Disk::checkPartedOutput(), storage::Loop::checkReuse(), storage::Storage::commit(), storage::LvmVg::commitChanges(), storage::DmPartCo::commitChanges(), storage::Disk::commitChanges(), storage::Dasd::commitChanges(), storage::Container::commitChanges(), storage::Storage::commitPair(), storage::Container::compareContainer(), storage::Disk::createChecks(), storage::Md::createCmd(), storage::Loop::createFile(), storage::EtcFstab::createTabLine(), storage::Disk::defaultLabel(), storage::Storage::detectArch(), storage::Storage::detectDmmultipath(), storage::Storage::detectFsData(), storage::Storage::detectObjects(), storage::Dasd::detectPartitions(), storage::Dmmultipath::Dmmultipath(), storage::DmPart::DmPart(), storage::Dmraid::Dmraid(), storage::MdCo::doCreate(), storage::LvmVg::doCreate(), storage::LoopCo::doCreate(), storage::DmPartCo::doCreate(), storage::Disk::doCreate(), storage::DmPartCo::doCreateLabel(), storage::Disk::doCreateLabel(), storage::LvmVg::doCreateVg(), storage::Volume::doCrsetup(), storage::Volume::doCryptsetup(), storage::Dasd::doDasdfmt(), storage::SystemCmd::doExecute(), storage::LvmVg::doExtendVg(), storage::Dasd::doFdasd(), storage::Volume::doFormat(), storage::Volume::doFstabUpdate(), storage::Volume::doLosetup(), storage::Volume::doMount(), storage::LvmVg::doReduceVg(), storage::NfsCo::doRemove(), storage::MdCo::doRemove(), storage::LvmVg::doRemove(), storage::LoopCo::doRemove(), storage::DmraidCo::doRemove(), storage::DmPartCo::doRemove(), storage::DmCo::doRemove(), storage::Disk::doRemove(), storage::LvmVg::doRemoveVg(), storage::LvmVg::doResize(), storage::DmPartCo::doResize(), storage::Disk::doResize(), storage::Volume::doSetLabel(), storage::DmPartCo::doSetType(), storage::Disk::doSetType(), storage::Storage::dumpObjectList(), storage::Disk::enlargeGpt(), storage::SystemCmd::execute(), storage::SystemCmd::executeBackground(), storage::EtcFstab::flush(), storage::DmPartCo::forgetChangePartitionId(), storage::Disk::forgetChangePartitionId(), storage::DmPartCo::freeCylindersAfterPartition(), storage::Disk::freeCylindersAfterPartition(), storage::Storage::getAllUsedFs(), storage::LvmVg::getCommitActions(), storage::DmPartCo::getCommitActions(), storage::Dasd::getCommitActions(), storage::Storage::getCommitInfo(), storage::Storage::getDiskList(), storage::DmCo::getDmData(), storage::Volume::getFilesysSysfsPath(), storage::Volume::getFreeLoop(), storage::Volume::getFsData(), storage::Volume::getFstabData(), storage::Volume::getFstabDevice(), storage::Dasd::getGeometry(), storage::LvmVg::getInfo(), storage::DmPartCo::getInfo(), storage::Volume::getLoopData(), storage::LoopCo::getLoopData(), storage::Loop::getLoopMajor(), storage::getMajorDevices(), storage::MdCo::getMdData(), storage::Md::getMdMajor(), storage::Volume::getMountData(), storage::NfsCo::getNfsData(), storage::DmPartCo::getPartition(), storage::Disk::getPartitionAfter(), storage::getRevUdevMap(), storage::Dm::getTableInfo(), storage::Container::getToCommit(), storage::getUdevMap(), storage::SystemCmd::getUntilEOF(), storage::Disk::getUnusedSpace(), storage::Storage::handleHald(), haveQuota(), storage::Storage::ignoreError(), storage::PeContainer::init(), storage::DmPartCo::init(), storage::Storage::initDisk(), storage::Storage::initialize(), storage::AsciiFile::loadFile(), storage::Lock::Lock(), storage::Storage::logCo(), storage::Partition::logDifference(), storage::NfsCo::logDifference(), storage::Nfs::logDifference(), storage::MdCo::logDifference(), storage::Md::logDifference(), storage::LvmVg::logDifference(), storage::LvmLv::logDifference(), storage::LoopCo::logDifference(), storage::Loop::logDifference(), storage::DmPartCo::logDifference(), storage::DmPart::logDifference(), storage::DmCo::logDifference(), storage::Dm::logDifference(), storage::Disk::logDifference(), storage::Container::logDifference(), storage::SystemCmd::logOutput(), storage::Storage::logSystemInfo(), storage::Md::mdadmLine(), storage::DmraidCo::newP(), storage::DmPartCo::newP(), storage::DmmultipathCo::newP(), storage::LvmVg::normalizeDmDevices(), storage::DmPartCo::numToName(), storage::operator<(), storage::Volume::prepareRemove(), printFile(), storage::ProcMounts::ProcMounts(), storage::ProcPart::ProcPart(), storage::EtcFstab::readFiles(), storage::Storage::removeContainer(), storage::DmPartCo::removeDmPart(), storage::Storage::removeDmTableTo(), storage::DmPartCo::removeFromMemory(), storage::Disk::removeFromMemory(), storage::AsciiFile::removeIfEmpty(), storage::MdCo::removeMd(), storage::DmPartCo::removePartition(), storage::Disk::removePartition(), storage::Dasd::removePartition(), storage::DmPartCo::removePresentPartitions(), storage::Disk::removePresentPartitions(), storage::LvmVg::removeVg(), storage::NfsCo::removeVolume(), storage::LoopCo::removeVolume(), storage::DmPartCo::removeVolume(), storage::DmCo::removeVolume(), storage::Storage::rescanEverything(), storage::Volume::resizeFs(), storage::DmPartCo::resizePartition(), storage::Disk::resizePartition(), storage::LvmVg::resizeVolume(), storage::DmPartCo::resizeVolume(), storage::Disk::resizeVolume(), storage::ScrollBarHandler::setCurValue(), storage::Storage::setDefaultMountBy(), storage::Volume::setEncryption(), storage::Loop::setEncryption(), storage::Volume::setFormat(), storage::Partition::setFormat(), storage::LvmVg::setPeSize(), storage::Storage::sortCommitLists(), storage::Storage::Storage(), storage::Volume::sysfsPath(), storage::Partition::sysfsPath(), storage::Dm::sysfsPath(), storage::SystemCmd::SystemCmd(), storage::Volume::triggerUdevUpdate(), storage::DmPartCo::updateDelDev(), storage::Storage::updateDmEmptyPeMap(), storage::DmCo::updateDmMaps(), storage::EtcFstab::updateEntry(), storage::DmPartCo::validPartition(), storage::Storage::waitForDevice(), storage::Lock::~Lock(), and storage::Storage::~Storage().

#define y2milestone ( format,
...   )     logMsgVaArgs(storage::MILESTONE, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)

Referenced by storage::DmraidCo::activate(), storage::Dm::activate(), storage::DmPartCo::activate_part(), storage::EtcFstab::addEntry(), storage::Volume::canResize(), storage::MdCo::changeMdChunk(), storage::MdCo::changeMdParity(), storage::MdCo::changeMdType(), storage::Disk::changeNumbers(), storage::Disk::changePartitionArea(), storage::MdCo::checkMd(), storage::Storage::commit(), storage::LvmVg::commitChanges(), storage::DmPartCo::commitChanges(), storage::Disk::commitChanges(), storage::Dasd::commitChanges(), storage::Storage::commitPair(), storage::Disk::createChecks(), storage::EtcFstab::createCrtabLine(), storage::EtcFstab::createTabLine(), storage::Storage::detectDmraid(), storage::Volume::detectEncryption(), storage::Storage::detectFsData(), storage::Disk::detectGeometry(), storage::Dasd::detectGeometry(), storage::Storage::detectLvmVgs(), storage::Disk::detectPartitions(), storage::Dasd::detectPartitions(), storage::Dasd::detectPartitionsFdasd(), storage::MdCo::doCreate(), storage::LvmVg::doCreate(), storage::DmPartCo::doCreate(), storage::Disk::doCreate(), storage::DmPartCo::doCreateLabel(), storage::Disk::doCreateLabel(), storage::LvmVg::doCreateVg(), storage::Volume::doCryptsetup(), storage::Dasd::doDasdfmt(), storage::LvmVg::doExtendVg(), storage::Volume::doFstabUpdate(), storage::Volume::doLosetup(), storage::Volume::doMount(), storage::LvmVg::doReduceVg(), storage::MdCo::doRemove(), storage::LvmVg::doRemove(), storage::DmraidCo::doRemove(), storage::DmPartCo::doRemove(), storage::Disk::doRemove(), storage::LvmVg::doRemoveVg(), storage::LvmVg::doResize(), storage::DmPartCo::doResize(), storage::Disk::doResize(), storage::DmPartCo::doSetType(), storage::Disk::doSetType(), storage::EtcFstab::findCrtab(), storage::EtcFstab::findFile(), storage::Disk::forgetChangePartitionId(), storage::Volume::fstabUpdateDone(), storage::Dm::getDmMajor(), storage::Volume::getFreeLoop(), storage::Dasd::getGeometry(), storage::MdCo::getMdData(), storage::MdCo::getMdState(), storage::Volume::getMountData(), storage::Disk::getPartedSectors(), storage::Disk::getPartedValues(), storage::Disk::getPartitionAfter(), storage::Dm::getTableInfo(), storage::LvmVg::getToCommit(), storage::DmPartCo::getToCommit(), storage::Disk::getToCommit(), storage::Dasd::getToCommit(), storage::DmPartCo::handleWholeDevice(), storage::Storage::initDisk(), storage::Dasd::initializeDisk(), storage::Disk::isLogical(), storage::Disk::kbToCylinder(), storage::PeContainer::leByLvRemove(), storage::Volume::prepareRemove(), storage::EtcFstab::readFiles(), storage::Disk::redetectGeometry(), storage::Storage::removeContainer(), storage::DmPartCo::removeDmPart(), storage::EtcFstab::removeEntry(), storage::Container::removeFromList(), storage::MdCo::removeMd(), storage::Disk::removePartition(), storage::Dasd::removePartition(), storage::LvmVg::removeVg(), storage::MdCo::removeVolume(), storage::LvmVg::resizeVolume(), storage::SystemCmd::select(), storage::Storage::setDetectMountedVolumes(), storage::Storage::setEfiBoot(), storage::Volume::setEncryption(), storage::Volume::setFormat(), storage::Partition::setFormat(), storage::LvmVg::setPeSize(), storage::Storage::setRecursiveRemoval(), storage::Storage::setZeroNewPartitions(), storage::Storage::sortCommitLists(), and storage::EtcFstab::updateEntry().

#define y2war ( op   )     y2log_op(storage::WARNING, __FILE__, __LINE__, __FUNCTION__, op)

#define y2warning ( format,
...   )     logMsgVaArgs(storage::WARNING, __FILE__, __LINE__, __FUNCTION__, format, ##__VA_ARGS__)


Generated on Sun Dec 7 21:01:50 2008 for yast2-storage by  doxygen 1.5.6