mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 19:06:02 +03:00

1. Main include corresponding to .cpp file, if any. 2. DMD and LDC includes. 3. LLVM includes. 4. System includes. Also updated a few include guards to match the default format.
53 lines
1.3 KiB
C++
53 lines
1.3 KiB
C++
//===-- driver/configfile.h - LDC config file handling ----------*- C++ -*-===//
|
||
//
|
||
// LDC – the LLVM D compiler
|
||
//
|
||
// This file is distributed under the BSD-style LDC license. See the LICENSE
|
||
// file for details.
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
//
|
||
// Handles reading and parsing of an LDC config file (ldc.conf/ldc2.conf).
|
||
//
|
||
//===----------------------------------------------------------------------===//
|
||
|
||
#ifndef LDC_DRIVER_CONFIGFILE_H
|
||
#define LDC_DRIVER_CONFIGFILE_H
|
||
|
||
#include <string>
|
||
#include <vector>
|
||
|
||
namespace llvm { namespace sys { class Path; } }
|
||
|
||
namespace libconfig
|
||
{
|
||
class Config;
|
||
}
|
||
|
||
class ConfigFile
|
||
{
|
||
public:
|
||
typedef std::vector<const char*> s_vector;
|
||
typedef s_vector::iterator s_iterator;
|
||
|
||
public:
|
||
ConfigFile();
|
||
~ConfigFile();
|
||
|
||
bool read(const char* argv0, void* mainAddr, const char* filename);
|
||
|
||
s_iterator switches_begin() { return switches.begin(); }
|
||
s_iterator switches_end() { return switches.end(); }
|
||
|
||
const std::string& path() { return pathstr; }
|
||
|
||
private:
|
||
bool locate(llvm::sys::Path& path, const char* argv0, void* mainAddr, const char* filename);
|
||
|
||
libconfig::Config* cfg;
|
||
std::string pathstr;
|
||
|
||
s_vector switches;
|
||
};
|
||
|
||
#endif // LDC_DRIVER_CONFIGFILE_H
|