#pragma region CPL License
/*
Nuclex Engine
Copyright (C) 2002-2008 Nuclex Development Labs
This library is free software; you can redistribute it and/or
modify it under the terms of the IBM Common Public License as
published by the IBM Corporation; either version 1.0 of the
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
IBM Common Public License for more details.
You should have received a copy of the IBM Common Public
License along with this library
*/
#pragma endregion
#ifndef NUCLEX_MAIN_MAIN_H
#define NUCLEX_MAIN_MAIN_H
#include "Nuclex/Nuclex.h"
#include "Nuclex/Support/String.h"
// --------------------------------------------------------------------------------------------- //
namespace Nuclex {
/// Environment information provider
///
/// Provides informations about the environment in which the application was launched
/// (eg. which path, operating system)
///
class Environment {
/// Operating systems
public: enum OperatingSystem {
/// Unknown OS
OS_UNKNWON = 0,
/// Win32
OS_WIN32,
/// Linux
OS_LINUX
};
/// Releases all resources owned by the Environment instance
public: virtual ~Environment() {}
//
// Environment implementation
//
/// Displays a message box
/// Caption the displayed message box will have
/// Text that will be displayed to the user
public: virtual void showMessageBox(const string &sCaption, const string &sText) = 0;
/// Displays an error message with Ok / Cancel buttons
/// Caption the displayed message box will have
/// Text that will be displayed to the user
/// True if user has pressed the Ok button
public: virtual bool showErrorBox(const string &sCaption, const string &sText) = 0;
///
/// Returns the command line arguments with which the application was launched
///
/// The command line string
public: virtual const string &getCommandLine() const = 0;
/// Obtains the path from which the application was launched
/// The application's launch path
public: virtual const string &getLaunchPath() const = 0;
/// Retrieves the path in which the application's executable resides
/// The application's executable path
public: virtual const string &getApplicationPath() const = 0;
/// Returns the operating system under which the application runs
/// The operating system the application runs on
public: virtual OperatingSystem getOperatingSystem() const = 0;
/// Returns the amount of memory installed on the system in megabytes
/// The amount of memory in megabytes/returns>
public: virtual size_t getMemorySize() const = 0;
};
} // namespace Nuclex
// --------------------------------------------------------------------------------------------- //
/// Signature of the program entry point the user has to provide
///
/// Provides informations about the environment to the application
///
///
/// This is the method the user has to provide instead of main() or WinMain() when linking
/// with the Nuclex.Main library.
///
extern void NuclexMain(const Nuclex::Environment &Environment);
// --------------------------------------------------------------------------------------------- //
#endif // NUCLEX_MAIN_MAIN_H