From 9d99b539bfaabe45a43948edf37e900401288f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sun, 28 Jul 2013 08:40:15 +0200 Subject: Parsing the version files, part IV Also, start of big refactors. --- libmultimc/include/instanceloader.h | 32 ++++++++++++++------------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'libmultimc/include/instanceloader.h') diff --git a/libmultimc/include/instanceloader.h b/libmultimc/include/instanceloader.h index fd6d04d6..af5bf92d 100644 --- a/libmultimc/include/instanceloader.h +++ b/libmultimc/include/instanceloader.h @@ -36,22 +36,18 @@ public: */ static InstanceLoader &get() { return loader; } - /*! - * \brief Error codes returned by functions in the InstanceLoader and InstanceType classes. - * - * - NoError indicates that no error occurred. - * - OtherError indicates that an unspecified error occurred. - * - InstExists is returned by createInstance() if the given instance directory is already an instance. - * - NotAnInstance is returned by loadInstance() if the given instance directory is not a valid instance. - * - CantCreateDir is returned by createInstance( if the given instance directory can't be created.) - */ - enum InstLoaderError + enum InstLoadError + { + NoLoadError = 0, + UnknownLoadError, + NotAnInstance + }; + + enum InstCreateError { - NoError = 0, - OtherError, - + NoCreateError = 0, + UnknownCreateError, InstExists, - NotAnInstance, CantCreateDir }; @@ -61,21 +57,21 @@ public: * \param inst Pointer to store the created instance in. * \param type The type of instance to create. * \param instDir The instance's directory. - * \return An InstLoaderError error code. + * \return An InstCreateError error code. * - InstExists if the given instance directory is already an instance. * - CantCreateDir if the given instance directory cannot be created. */ - InstLoaderError createInstance(Instance *&inst, const QString &instDir); + InstCreateError createInstance(Instance *&inst, const QString &instDir); /*! * \brief Loads an instance from the given directory. * Checks the instance's INI file to figure out what the instance's type is first. * \param inst Pointer to store the loaded instance in. * \param instDir The instance's directory. - * \return An InstLoaderError error code. + * \return An InstLoadError error code. * - NotAnInstance if the given instance directory isn't a valid instance. */ - InstLoaderError loadInstance(Instance *&inst, const QString &instDir); + InstLoadError loadInstance(Instance *&inst, const QString &instDir); private: InstanceLoader(); -- cgit v1.2.3