Skip to content

Commit

Permalink
rename some of the new Environment methods, make PocoDoc config chang…
Browse files Browse the repository at this point in the history
…es backwards-compatible, revert PocoDoc config changes, make doc build scripts work on macos
  • Loading branch information
obiltschnig committed Nov 8, 2017
1 parent f0a7901 commit 079c9a6
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 145 deletions.
36 changes: 16 additions & 20 deletions Foundation/include/Poco/Environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,28 @@ class Foundation_API Environment
{
public:
typedef UInt8 NodeId[6]; /// Ethernet address.

static std::string get(const std::string& name);
/// Returns the value of the environment variable
/// with the given name. Throws a NotFoundException
/// if the variable does not exist.

static std::string get(const std::string& name, const std::string& defaultValue);
/// Returns the value of the environment variable
/// with the given name. If the environment variable
/// is undefined, returns defaultValue instead.

static bool has(const std::string& name);
/// Returns true iff an environment variable
/// with the given name is defined.

static void set(const std::string& name, const std::string& value);
/// Sets the environment variable with the given name
/// to the given value.

static std::string osName();
/// Returns the operating system name.

static std::string osDisplayName();
/// Returns the operating system name in a
/// "user-friendly" way.
Expand All @@ -61,33 +61,33 @@ class Foundation_API Environment
/// "Windows XP" or "Windows 7/Server 2008 SP2".
/// On other platforms, returns the same as
/// osName().

static std::string osVersion();
/// Returns the operating system version.

static std::string osArchitecture();
/// Returns the operating system architecture.

static std::string nodeName();
/// Returns the node (or host) name.

static void nodeId(NodeId& id);
/// Returns the Ethernet address of the first Ethernet
/// adapter found on the system.
///
/// Throws a SystemException if no Ethernet adapter is available.

static std::string nodeId();
/// Returns the Ethernet address (format "xx:xx:xx:xx:xx:xx")
/// of the first Ethernet adapter found on the system.
///
/// Throws a SystemException if no Ethernet adapter is available.

static unsigned processorCount();
/// Returns the number of processors installed in the system.
///
/// If the number of processors cannot be determined, returns 1.

static Poco::UInt32 libraryVersion();
/// Returns the POCO C++ Libraries version as a hexadecimal
/// number in format 0xAABBCCDD, where
Expand All @@ -105,19 +105,15 @@ class Foundation_API Environment
/// Return the operating system as defined
/// in the include Foundation/Platform.h (POCO_OS)

static Poco::Int32 cpu();
/// Return the underlying cpu that runs this operating system
static Poco::Int32 arch();
/// Return the underlying cpu architecture that runs this operating system
/// as defined in Foundation/Platform (POCO_ARCH)

static bool osFamilyUnix();
static bool isUnix();
/// Return true if the operating system belongs to the Linux family

static bool osFamilyWindows();
static bool isWindows();
/// Return true if the operating system belongs to the Windows family

static bool osFamilyVms();
/// Return true if the operating system belongs to the VMS family

};


Expand Down
28 changes: 12 additions & 16 deletions Foundation/src/Environment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ std::string Environment::get(const std::string& name, const std::string& default
return defaultValue;
}


bool Environment::has(const std::string& name)
{
return EnvironmentImpl::hasImpl(name);
}


void Environment::set(const std::string& name, const std::string& value)
{
EnvironmentImpl::setImpl(name, value);
Expand All @@ -74,18 +74,18 @@ std::string Environment::osDisplayName()
return EnvironmentImpl::osDisplayNameImpl();
}


std::string Environment::osVersion()
{
return EnvironmentImpl::osVersionImpl();
}


std::string Environment::osArchitecture()
{
return EnvironmentImpl::osArchitectureImpl();
}


std::string Environment::nodeName()
{
Expand Down Expand Up @@ -126,17 +126,20 @@ Poco::UInt32 Environment::libraryVersion()
return POCO_VERSION;
}


Poco::Int32 Environment::os()
{
return POCO_OS;
}

Poco::Int32 Environment::cpu()

Poco::Int32 Environment::arch()
{
return POCO_ARCH;
}

bool Environment::osFamilyUnix()

bool Environment::isUnix()
{
#if defined(POCO_OS_FAMILY_UNIX)
return true;
Expand All @@ -145,7 +148,8 @@ bool Environment::osFamilyUnix()
#endif
}

bool Environment::osFamilyWindows()

bool Environment::isWindows()
{
#if defined(POCO_OS_FAMILY_WINDOWS)
return true;
Expand All @@ -154,13 +158,5 @@ bool Environment::osFamilyWindows()
#endif
}

bool Environment::osFamilyVms()
{
#if defined(POCO_OS_FAMILY_VMS)
return true;
#else
return false;
#endif
}

} // namespace Poco
57 changes: 15 additions & 42 deletions PocoDoc/cfg/mkdoc-poco.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
expat*.h,
zconf.h,
zlib.h,
Alignment.h,
QName.h,
CppUnitException.h,
Constants.h,
inffast.h,
PDF/include/*.h,
CppParser/include/*.h
</exclude>
</files>
<pages>
Expand All @@ -35,41 +28,21 @@
${PocoBuild}/*/doc/images
</resources>
<compiler>
<windows>
<exec>cl.exe</exec>
<options>
${Includes},
/I${PocoBase}/openssl/include
/I${VC}/include,
/I${WDK}/shared
/I${WDK}/um
/I${WDK}/ucrt
/nologo,
/D_DEBUG,
/E,
/C,
/DPOCO_NO_GCC_API_ATTRIBUTE
/DPOCO_NO_WINDOWS_H
</options>
<path>${VC}/bin</path>
<usePipe>true</usePipe>
</windows>
<unix>
<exec>${CXX} ${CXXFLAGS}</exec>
<options>
${Includes},
-I/usr/local/mysql/include,
-I/usr/include/mysql,
-I/usr/include/postgresql,
-D_DEBUG,
-E,
-C,
-DPOCO_NO_GCC_API_ATTRIBUTE
-DPOCO_NO_WINDOWS_H
</options>
<path></path>
<usePipe>true</usePipe>
</unix>
<exec>clang++</exec>
<options>
${Includes},
-I/usr/local/mysql/include,
-I/usr/include/mysql,
-D_DEBUG,
-E,
-C,
-DPOCO_NO_GCC_API_ATTRIBUTE,
-xc++
-std=c++11,
-stdlib=libc++
</options>
<path></path>
<usePipe>true</usePipe>
</compiler>
<language>EN</language>
<charset>utf-8</charset>
Expand Down
16 changes: 3 additions & 13 deletions PocoDoc/cfg/mkdocumentation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
expat*.h,
zconf.h,
zlib.h,
XMLStreamParser.h,
CppUnitException.h,
RepeatedTest.h,
${PocoBuild}/Util/include/Poco/Util/Units.h
</exclude>
</files>
<pages>
Expand All @@ -31,23 +29,15 @@
${PocoBuild}/*/doc/images
</resources>
<compiler>
<exec>C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe</exec>
<exec>g++</exec>
<options>
${Includes},
-I/usr/local/mysql/include,
-I/usr/include/mysql,
-I/usr/include/postgresql,
/I${PocoBase}/openssl/include
/IC:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include,
/IC:\Program Files (x86)\Windows Kits\8.1\Include\shared,
/IC:\Program Files (x86)\Windows Kits\8.1\Include\um,
/IC:\Program Files (x86)\Windows Kits\10\Include\10.0.15063.0\ucrt,
/nologo,
-D_DEBUG,
-E,
-C,
-DPOCO_NO_GCC_API_ATTRIBUTE
-DPOCO_NO_WINDOWS_H
</options>
<path></path>
<usePipe>true</usePipe>
Expand Down Expand Up @@ -104,7 +94,7 @@
<loggers>
<root>
<channel>c1</channel>
<level>information</level>
<level>warning</level>
</root>
</loggers>
<channels>
Expand Down
Loading

0 comments on commit 079c9a6

Please sign in to comment.