From ebcc95da4c26369511caa90d89c5ed06e1e4853a Mon Sep 17 00:00:00 2001 From: Treeki Date: Thu, 14 Oct 2010 20:17:20 +0200 Subject: brlyt packing added, plus some changes in the existing API (mostly for const correctness). brlyt writing may still need some testing (especially for the material structs) --- lyt/directorypackage.cpp | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lyt/directorypackage.cpp') diff --git a/lyt/directorypackage.cpp b/lyt/directorypackage.cpp index e8f31b9..dd8c39d 100644 --- a/lyt/directorypackage.cpp +++ b/lyt/directorypackage.cpp @@ -26,7 +26,7 @@ LYTDirectoryPackage::LYTDirectoryPackage(QString path) : LYTPackageBase() { -QStringList LYTDirectoryPackage::listSubDirIfExists(QString dirName) { +QStringList LYTDirectoryPackage::listSubDirIfExists(QString dirName) const { QDir search(m_path); if (search.cd(dirName)) { @@ -37,7 +37,7 @@ QStringList LYTDirectoryPackage::listSubDirIfExists(QString dirName) { } -QByteArray LYTDirectoryPackage::getFileFromSubDirIfExists(QString dirName, QString fileName) { +QByteArray LYTDirectoryPackage::getFileFromSubDirIfExists(QString dirName, QString fileName) const { QDir search(m_path); if (search.cd(dirName)) { @@ -71,37 +71,37 @@ bool LYTDirectoryPackage::writeFileToSubDir(QString dirName, QString fileName, Q -QStringList LYTDirectoryPackage::listAnims() { +QStringList LYTDirectoryPackage::listAnims() const { return this->listSubDirIfExists("anim"); } -QStringList LYTDirectoryPackage::listLayouts() { +QStringList LYTDirectoryPackage::listLayouts() const { return this->listSubDirIfExists("blyt"); } -QStringList LYTDirectoryPackage::listTextures() { +QStringList LYTDirectoryPackage::listTextures() const { return this->listSubDirIfExists("timg"); } -QStringList LYTDirectoryPackage::listFonts() { +QStringList LYTDirectoryPackage::listFonts() const { return this->listSubDirIfExists("font"); } -QByteArray LYTDirectoryPackage::getAnim(QString name) { +QByteArray LYTDirectoryPackage::getAnim(QString name) const { return this->getFileFromSubDirIfExists("anim", name); } -QByteArray LYTDirectoryPackage::getLayout(QString name) { +QByteArray LYTDirectoryPackage::getLayout(QString name) const { return this->getFileFromSubDirIfExists("blyt", name); } -QByteArray LYTDirectoryPackage::getTexture(QString name) { +QByteArray LYTDirectoryPackage::getTexture(QString name) const { return this->getFileFromSubDirIfExists("timg", name); } -QByteArray LYTDirectoryPackage::getFont(QString name) { +QByteArray LYTDirectoryPackage::getFont(QString name) const { return this->getFileFromSubDirIfExists("font", name); } @@ -131,6 +131,6 @@ bool LYTDirectoryPackage::savePackage() { } -QString LYTDirectoryPackage::description() { +QString LYTDirectoryPackage::description() const { return m_path; } -- cgit v1.2.3