summaryrefslogtreecommitdiffstats
path: root/logic/OneSixLibrary.h
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-04 02:53:05 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-04 02:53:05 +0100
commitbb7e8985f6d189de0acac6a1c3033cb16378c1fb (patch)
tree7c2e88c7184a7f5acf5e7a03be5c5f0bf6904113 /logic/OneSixLibrary.h
parentd6e4fb29713d6ce55b092c0e22412f6121e7f516 (diff)
downloadMultiMC-bb7e8985f6d189de0acac6a1c3033cb16378c1fb.tar
MultiMC-bb7e8985f6d189de0acac6a1c3033cb16378c1fb.tar.gz
MultiMC-bb7e8985f6d189de0acac6a1c3033cb16378c1fb.tar.lz
MultiMC-bb7e8985f6d189de0acac6a1c3033cb16378c1fb.tar.xz
MultiMC-bb7e8985f6d189de0acac6a1c3033cb16378c1fb.zip
Reformat and (slightly) decruft all the things.
Diffstat (limited to 'logic/OneSixLibrary.h')
-rw-r--r--logic/OneSixLibrary.h36
1 files changed, 27 insertions, 9 deletions
diff --git a/logic/OneSixLibrary.h b/logic/OneSixLibrary.h
index 5e58ef89..3a772420 100644
--- a/logic/OneSixLibrary.h
+++ b/logic/OneSixLibrary.h
@@ -1,9 +1,26 @@
+/* Copyright 2013 MultiMC Contributors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
#pragma once
+
#include <QString>
#include <QStringList>
#include <QMap>
-#include <memory>
#include <QJsonObject>
+#include <memory>
+
#include "OpSys.h"
class Rule;
@@ -14,7 +31,7 @@ private:
// basic values used internally (so far)
QString m_name;
QString m_base_url = "http://s3.amazonaws.com/Minecraft.Download/libraries/";
- QList<std::shared_ptr<Rule> > m_rules;
+ QList<std::shared_ptr<Rule>> m_rules;
// custom values
/// absolute URL. takes precedence over m_download_path, if defined
@@ -39,25 +56,26 @@ private:
bool m_is_native = false;
/// native suffixes per OS
QMap<OpSys, QString> m_native_suffixes;
+
public:
QStringList extract_excludes;
-
+
public:
/// Constructor
OneSixLibrary(QString name)
{
m_name = name;
}
-
+
QJsonObject toJson();
-
+
/**
* finalize the library, processing the input values into derived values and state
- *
+ *
* This SHALL be called after all the values are parsed or after any further change.
*/
void finalize();
-
+
/// Set the library composite name
void setName(QString name);
/// get a decent-looking name
@@ -77,13 +95,13 @@ public:
}
/// Set the url base for downloads
void setBaseUrl(QString base_url);
-
+
/// Call this to mark the library as 'native' (it's a zip archive with DLLs)
void setIsNative();
/// Attach a name suffix to the specified OS native
void addNative(OpSys os, QString suffix);
/// Set the load rules
- void setRules(QList<std::shared_ptr<Rule> > rules);
+ void setRules(QList<std::shared_ptr<Rule>> rules);
/// Returns true if the library should be loaded (or extracted, in case of natives)
bool isActive();