General tidy and refactoring:

* Use nullptr (C++11) instead of NULL.
* Put each file into its own namespace declaration.
* Remove "using namespace" directives and add scope qualifiers.
* Control when beast's implementation of std::equal (C++14) is used.
* Tidy up some const declarations.

Conflicts:
	src/ripple_app/shamap/SHAMapSync.cpp
	src/ripple_app/tx/TransactionEngine.cpp
This commit is contained in:
Howard Hinnant
2014-03-07 18:54:11 -05:00
committed by Vinnie Falco
parent c581ffb8a4
commit cad50c68a8
519 changed files with 3618 additions and 2726 deletions

View File

@@ -702,6 +702,12 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\ECDSACanonical.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\HashUtilities.cpp"> <ClCompile Include="..\..\src\ripple\sslutil\impl\HashUtilities.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>

View File

@@ -1494,6 +1494,9 @@
<ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp"> <ClCompile Include="..\..\src\ripple\common\impl\RippleSSLContext.cpp">
<Filter>[1] Ripple\common\impl</Filter> <Filter>[1] Ripple\common\impl</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\..\src\ripple\sslutil\impl\ECDSACanonical.cpp">
<Filter>[1] Ripple\sslutil\impl</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h"> <ClInclude Include="..\..\src\ripple_basics\containers\RangeSet.h">

View File

@@ -25,6 +25,8 @@
#include <algorithm> #include <algorithm>
#if ! BEAST_NO_CXX14_EQUAL
namespace std { namespace std {
namespace detail { namespace detail {
@@ -88,3 +90,5 @@ bool equal (FwdIt1 first1, FwdIt1 last1,
} }
#endif #endif
#endif

View File

@@ -23,22 +23,32 @@
// Sets C++14 compatibility configuration macros based on build environment // Sets C++14 compatibility configuration macros based on build environment
// Disables beast c++14 compatibility additions when set to 1 // Disables beast c++14 compatibility additions when set to 1
// Note, some compatibilty features are enabled or disabled individually.
// //
#ifndef BEAST_NO_CXX14_COMPATIBILITY #ifndef BEAST_NO_CXX14_COMPATIBILITY
# ifdef _MSC_VER # ifdef _MSC_VER
# define BEAST_NO_CXX14_COMPATIBILITY 1 # define BEAST_NO_CXX14_COMPATIBILITY 1
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201305
# define BEAST_NO_CXX14_COMPATIBILITY 1
# else # else
# define BEAST_NO_CXX14_COMPATIBILITY 0 # define BEAST_NO_CXX14_COMPATIBILITY 0
# endif # endif
#endif #endif
// Disables beast's make_unique // Disables beast's std::make_unique
#ifndef BEAST_NO_CXX14_MAKE_UNIQUE #ifndef BEAST_NO_CXX14_MAKE_UNIQUE
# ifdef _MSC_VER # ifdef _MSC_VER
# define BEAST_NO_CXX14_MAKE_UNIQUE 1 # define BEAST_NO_CXX14_MAKE_UNIQUE 1
# elif defined(__clang__) && defined(_LIBCPP_VERSION) && __cplusplus >= 201305
# define BEAST_NO_CXX14_MAKE_UNIQUE 1
# else # else
# define BEAST_NO_CXX14_MAKE_UNIQUE 0 # define BEAST_NO_CXX14_MAKE_UNIQUE 0
# endif # endif
#endif #endif
// Disables beast's std::equal safe iterator overloads
#ifndef BEAST_NO_CXX14_EQUAL
# define BEAST_NO_CXX14_EQUAL 0
#endif
#endif #endif

View File

@@ -80,7 +80,7 @@ public:
private: private:
// The number of handlers pending. // The number of handlers pending.
Atomic <int> m_pending; beast::Atomic <int> m_pending;
}; };
} }

View File

@@ -126,9 +126,6 @@
#undef _aligned_msize #undef _aligned_msize
#endif #endif
namespace beast
{
#include "containers/DynamicObject.cpp" #include "containers/DynamicObject.cpp"
#include "containers/NamedValueSet.cpp" #include "containers/NamedValueSet.cpp"
#include "containers/PropertySet.cpp" #include "containers/PropertySet.cpp"
@@ -256,8 +253,6 @@ namespace beast
#include "threads/HighResolutionTimer.cpp" #include "threads/HighResolutionTimer.cpp"
}
// Has to be outside the beast namespace // Has to be outside the beast namespace
extern "C" { extern "C" {
void beast_reportFatalError (char const* message, char const* fileName, int lineNumber) void beast_reportFatalError (char const* message, char const* fileName, int lineNumber)

View File

@@ -63,13 +63,16 @@
#include "system/StandardIncludes.h" #include "system/StandardIncludes.h"
namespace beast { namespace beast
{
class InputStream; class InputStream;
class OutputStream; class OutputStream;
class FileInputStream; class FileInputStream;
class FileOutputStream; class FileOutputStream;
} // namespace beast
// Order matters, since headers don't have their own #include lines. // Order matters, since headers don't have their own #include lines.
// Add new includes to the bottom. // Add new includes to the bottom.
@@ -209,8 +212,6 @@ class FileOutputStream;
#include "thread/Workers.h" #include "thread/Workers.h"
}
#if BEAST_MSVC #if BEAST_MSVC
#pragma warning (pop) #pragma warning (pop)
#endif #endif

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_ARRAY_H_INCLUDED #ifndef BEAST_ARRAY_H_INCLUDED
#define BEAST_ARRAY_H_INCLUDED #define BEAST_ARRAY_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Holds a resizable array of primitive or copy-by-value objects. Holds a resizable array of primitive or copy-by-value objects.
@@ -1052,4 +1055,6 @@ private:
} }
}; };
} // namespace beast
#endif // BEAST_ARRAY_H_INCLUDED #endif // BEAST_ARRAY_H_INCLUDED

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_ARRAYALLOCATIONBASE_H_INCLUDED #ifndef BEAST_ARRAYALLOCATIONBASE_H_INCLUDED
#define BEAST_ARRAYALLOCATIONBASE_H_INCLUDED #define BEAST_ARRAYALLOCATIONBASE_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Implements some basic array storage allocation functions. Implements some basic array storage allocation functions.
@@ -126,4 +129,6 @@ public:
int numAllocated; int numAllocated;
}; };
} // namespace beast
#endif // BEAST_ARRAYALLOCATIONBASE_H_INCLUDED #endif // BEAST_ARRAYALLOCATIONBASE_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
DynamicObject::DynamicObject() DynamicObject::DynamicObject()
{ {
} }
@@ -72,3 +75,5 @@ void DynamicObject::clear()
{ {
properties.clear(); properties.clear();
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_DYNAMICOBJECT_H_INCLUDED #ifndef BEAST_DYNAMICOBJECT_H_INCLUDED
#define BEAST_DYNAMICOBJECT_H_INCLUDED #define BEAST_DYNAMICOBJECT_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Represents a dynamically implemented object. Represents a dynamically implemented object.
@@ -112,6 +115,6 @@ private:
NamedValueSet properties; NamedValueSet properties;
}; };
} // namespace beast
#endif // BEAST_DYNAMICOBJECT_H_INCLUDED #endif // BEAST_DYNAMICOBJECT_H_INCLUDED

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_ELEMENTCOMPARATOR_H_INCLUDED #ifndef BEAST_ELEMENTCOMPARATOR_H_INCLUDED
#define BEAST_ELEMENTCOMPARATOR_H_INCLUDED #define BEAST_ELEMENTCOMPARATOR_H_INCLUDED
namespace beast
{
#ifndef DOXYGEN #ifndef DOXYGEN
/** This is an internal helper class which converts a beast ElementComparator style /** This is an internal helper class which converts a beast ElementComparator style
@@ -185,5 +188,7 @@ public:
} }
}; };
} // namespace beast
#endif #endif

View File

@@ -24,6 +24,8 @@
#ifndef BEAST_LINKEDLISTPOINTER_H_INCLUDED #ifndef BEAST_LINKEDLISTPOINTER_H_INCLUDED
#define BEAST_LINKEDLISTPOINTER_H_INCLUDED #define BEAST_LINKEDLISTPOINTER_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
@@ -358,5 +360,6 @@ private:
ObjectType* item; ObjectType* item;
}; };
} // namespace beast
#endif // BEAST_LINKEDLISTPOINTER_H_INCLUDED #endif // BEAST_LINKEDLISTPOINTER_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
NamedValueSet::NamedValue::NamedValue() noexcept NamedValueSet::NamedValue::NamedValue() noexcept
{ {
} }
@@ -302,3 +305,5 @@ void NamedValueSet::copyToXmlAttributes (XmlElement& xml) const
} }
} }
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_NAMEDVALUESET_H_INCLUDED #ifndef BEAST_NAMEDVALUESET_H_INCLUDED
#define BEAST_NAMEDVALUESET_H_INCLUDED #define BEAST_NAMEDVALUESET_H_INCLUDED
namespace beast
{
class XmlElement; class XmlElement;
#ifndef DOXYGEN #ifndef DOXYGEN
class JSONFormatter; class JSONFormatter;
@@ -157,5 +160,6 @@ private:
friend class JSONFormatter; friend class JSONFormatter;
}; };
} // namespace beast
#endif // BEAST_NAMEDVALUESET_H_INCLUDED #endif // BEAST_NAMEDVALUESET_H_INCLUDED

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_OWNEDARRAY_H_INCLUDED #ifndef BEAST_OWNEDARRAY_H_INCLUDED
#define BEAST_OWNEDARRAY_H_INCLUDED #define BEAST_OWNEDARRAY_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** An array designed for holding objects. /** An array designed for holding objects.
@@ -885,5 +888,6 @@ private:
} }
}; };
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
PropertySet::PropertySet (const bool ignoreCaseOfKeyNames) PropertySet::PropertySet (const bool ignoreCaseOfKeyNames)
: properties (ignoreCaseOfKeyNames), : properties (ignoreCaseOfKeyNames),
fallbackProperties (nullptr), fallbackProperties (nullptr),
@@ -216,3 +219,5 @@ void PropertySet::restoreFromXml (const XmlElement& xml)
void PropertySet::propertyChanged() void PropertySet::propertyChanged()
{ {
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_PROPERTYSET_H_INCLUDED #ifndef BEAST_PROPERTYSET_H_INCLUDED
#define BEAST_PROPERTYSET_H_INCLUDED #define BEAST_PROPERTYSET_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
A set of named property values, which can be strings, integers, floating point, etc. A set of named property values, which can be strings, integers, floating point, etc.
@@ -203,5 +206,6 @@ private:
bool ignoreCaseOfKeys; bool ignoreCaseOfKeys;
}; };
} // namespace beast
#endif // BEAST_PROPERTYSET_H_INCLUDED #endif // BEAST_PROPERTYSET_H_INCLUDED

View File

@@ -24,6 +24,8 @@
#ifndef BEAST_SCOPEDVALUESETTER_H_INCLUDED #ifndef BEAST_SCOPEDVALUESETTER_H_INCLUDED
#define BEAST_SCOPEDVALUESETTER_H_INCLUDED #define BEAST_SCOPEDVALUESETTER_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
@@ -89,5 +91,6 @@ private:
const ValueType originalValue; const ValueType originalValue;
}; };
} // namespace beast
#endif // BEAST_SCOPEDVALUESETTER_H_INCLUDED #endif // BEAST_SCOPEDVALUESETTER_H_INCLUDED

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_SPARSESET_H_INCLUDED #ifndef BEAST_SPARSESET_H_INCLUDED
#define BEAST_SPARSESET_H_INCLUDED #define BEAST_SPARSESET_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Holds a set of primitive values, storing them as a set of ranges. Holds a set of primitive values, storing them as a set of ranges.
@@ -287,6 +290,6 @@ private:
} }
}; };
} // namespace beast
#endif // BEAST_SPARSESET_H_INCLUDED #endif // BEAST_SPARSESET_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
enum VariantStreamMarkers enum VariantStreamMarkers
{ {
varMarker_Int = 1, varMarker_Int = 1,
@@ -702,3 +705,5 @@ var var::readFromStream (InputStream& input)
return var::null; return var::null;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_VARIANT_H_INCLUDED #ifndef BEAST_VARIANT_H_INCLUDED
#define BEAST_VARIANT_H_INCLUDED #define BEAST_VARIANT_H_INCLUDED
namespace beast
{
#ifndef DOXYGEN #ifndef DOXYGEN
class SharedObject; class SharedObject;
class DynamicObject; class DynamicObject;
@@ -293,5 +296,6 @@ bool operator!= (const var& v1, const String& v2);
bool operator== (const var& v1, const char* v2); bool operator== (const var& v1, const char* v2);
bool operator!= (const var& v1, const char* v2); bool operator!= (const var& v1, const char* v2);
} // namespace beast
#endif // BEAST_VARIANT_H_INCLUDED #endif // BEAST_VARIANT_H_INCLUDED

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
void FPUFlags::clearUnsetFlagsFrom (FPUFlags const& flags) void FPUFlags::clearUnsetFlagsFrom (FPUFlags const& flags)
{ {
if (!flags.getMaskNaNs ().is_set ()) m_maskNaNs.clear (); if (!flags.getMaskNaNs ().is_set ()) m_maskNaNs.clear ();
@@ -38,3 +41,5 @@ void FPUFlags::clearUnsetFlagsFrom (FPUFlags const& flags)
if (!flags.getPrecision ().is_set ()) m_precision.clear (); if (!flags.getPrecision ().is_set ()) m_precision.clear ();
} }
} // namespace beast

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_FPUFLAGS_H_INCLUDED #ifndef BEAST_FPUFLAGS_H_INCLUDED
#define BEAST_FPUFLAGS_H_INCLUDED #define BEAST_FPUFLAGS_H_INCLUDED
namespace beast
{
/*============================================================================*/ /*============================================================================*/
/** /**
A set of IEEE FPU flags. A set of IEEE FPU flags.
@@ -331,5 +334,7 @@ private:
FPUFlags m_savedFlags; FPUFlags m_savedFlags;
}; };
} // namespace beast
#endif #endif

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
// //
// FatalError::Reporter // FatalError::Reporter
// //
@@ -130,3 +133,5 @@ public:
}; };
static FatalErrorTests fatalErrorTests; static FatalErrorTests fatalErrorTests;
} // namespace beast

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_CORE_FATALERROR_H_INCLUDED #ifndef BEAST_CORE_FATALERROR_H_INCLUDED
#define BEAST_CORE_FATALERROR_H_INCLUDED #define BEAST_CORE_FATALERROR_H_INCLUDED
namespace beast
{
/** Signal a fatal error. /** Signal a fatal error.
A fatal error indicates that the program has encountered an unexpected A fatal error indicates that the program has encountered an unexpected
@@ -146,4 +149,6 @@ private:
static Reporter* s_reporter; static Reporter* s_reporter;
}; };
} // namespace beast
#endif #endif

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED #ifndef BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED
#define BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED #define BEAST_CORE_DIAGNOSTIC_MEASUREFUNCTIONCALLTIME_H_INCLUDED
namespace beast
{
/** Measures the speed of invoking a function. */ /** Measures the speed of invoking a function. */
/** @{ */ /** @{ */
template <typename Function> template <typename Function>
@@ -77,4 +80,6 @@ double measureFunctionCallTime (Function f, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5, P
} }
#endif #endif
} // namespace beast
#endif #endif

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
SemanticVersion::SemanticVersion () SemanticVersion::SemanticVersion ()
: majorVersion (0) : majorVersion (0)
, minorVersion (0) , minorVersion (0)
@@ -517,3 +520,5 @@ public:
}; };
static SemanticVersionTests semanticVersionTests; static SemanticVersionTests semanticVersionTests;
} // namespace beast

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_SEMANTICVERSION_H_INCLUDED #ifndef BEAST_SEMANTICVERSION_H_INCLUDED
#define BEAST_SEMANTICVERSION_H_INCLUDED #define BEAST_SEMANTICVERSION_H_INCLUDED
namespace beast
{
/** A Semantic Version number. /** A Semantic Version number.
Identifies the build of a particular version of software using Identifies the build of a particular version of software using
@@ -71,4 +74,6 @@ private:
static bool chopIdentifiers (StringArray* value, bool preRelease, String& input); static bool chopIdentifiers (StringArray* value, bool preRelease, String& input);
}; };
} // namespace beast
#endif #endif

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_THROW_H_INCLUDED #ifndef BEAST_THROW_H_INCLUDED
#define BEAST_THROW_H_INCLUDED #define BEAST_THROW_H_INCLUDED
namespace beast
{
/** Throw an exception, with a debugger hook. /** Throw an exception, with a debugger hook.
This provides an opportunity to utilize the debugger before This provides an opportunity to utilize the debugger before
@@ -36,4 +39,6 @@ void Throw (Exception const& e, char const* = "", int = 0)
throw e; throw e;
} }
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
UnitTest::UnitTest (String const& className, UnitTest::UnitTest (String const& className,
String const& packageName, String const& packageName,
When when) When when)
@@ -477,3 +480,5 @@ public:
}; };
static UnitTestsPrinter unitTestsPrinter; static UnitTestsPrinter unitTestsPrinter;
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_UNITTEST_H_INCLUDED #ifndef BEAST_UNITTEST_H_INCLUDED
#define BEAST_UNITTEST_H_INCLUDED #define BEAST_UNITTEST_H_INCLUDED
namespace beast
{
class UnitTests; class UnitTests;
/** This is a base class for classes that perform a unit test. /** This is a base class for classes that perform a unit test.
@@ -547,4 +550,6 @@ private:
JournalSink m_sink; JournalSink m_sink;
}; };
} // namespace beast
#endif #endif

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
namespace UnitTestUtilities namespace UnitTestUtilities
{ {
@@ -197,3 +200,5 @@ public:
}; };
static UnitTestUtilitiesTests unitTestUtilitiesTests; static UnitTestUtilitiesTests unitTestUtilitiesTests;
} // namespace beast

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_UNITTESTUTILITIES_H_INCLUDED #ifndef BEAST_UNITTESTUTILITIES_H_INCLUDED
#define BEAST_UNITTESTUTILITIES_H_INCLUDED #define BEAST_UNITTESTUTILITIES_H_INCLUDED
namespace beast
{
namespace UnitTestUtilities namespace UnitTestUtilities
{ {
@@ -132,4 +135,6 @@ private:
} }
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
static StringArray parseWildcards (const String& pattern) static StringArray parseWildcards (const String& pattern)
{ {
StringArray s; StringArray s;
@@ -152,3 +155,5 @@ float DirectoryIterator::getEstimatedProgress() const
return detailedIndex / totalNumFiles; return detailedIndex / totalNumFiles;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_DIRECTORYITERATOR_H_INCLUDED #ifndef BEAST_DIRECTORYITERATOR_H_INCLUDED
#define BEAST_DIRECTORYITERATOR_H_INCLUDED #define BEAST_DIRECTORYITERATOR_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Searches through a the files in a directory, returning each file that is found. Searches through a the files in a directory, returning each file that is found.
@@ -143,4 +146,6 @@ private:
File currentFile; File currentFile;
}; };
} // namespace beast
#endif // BEAST_DIRECTORYITERATOR_H_INCLUDED #endif // BEAST_DIRECTORYITERATOR_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
// We need to make a shared singleton or else there are // We need to make a shared singleton or else there are
// issues with the leak detector and order of detruction. // issues with the leak detector and order of detruction.
// //
@@ -1101,3 +1104,4 @@ public:
static FileTests fileTests; static FileTests fileTests;
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_FILE_H_INCLUDED #ifndef BEAST_FILE_H_INCLUDED
#define BEAST_FILE_H_INCLUDED #define BEAST_FILE_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Represents a local file or directory. Represents a local file or directory.
@@ -948,5 +951,7 @@ private:
bool setFileReadOnlyInternal (bool) const; bool setFileReadOnlyInternal (bool) const;
}; };
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
int64 beast_fileSetPosition (void* handle, int64 pos); int64 beast_fileSetPosition (void* handle, int64 pos);
//============================================================================== //==============================================================================
@@ -88,3 +91,5 @@ bool FileInputStream::setPosition (int64 pos)
return true; return true;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_FILEINPUTSTREAM_H_INCLUDED #ifndef BEAST_FILEINPUTSTREAM_H_INCLUDED
#define BEAST_FILEINPUTSTREAM_H_INCLUDED #define BEAST_FILEINPUTSTREAM_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
An input stream that reads from a local file. An input stream that reads from a local file.
@@ -87,4 +90,6 @@ private:
size_t readInternal (void* buffer, size_t numBytes); size_t readInternal (void* buffer, size_t numBytes);
}; };
} // namespace beast
#endif // BEAST_FILEINPUTSTREAM_H_INCLUDED #endif // BEAST_FILEINPUTSTREAM_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
int64 beast_fileSetPosition (void* handle, int64 pos); int64 beast_fileSetPosition (void* handle, int64 pos);
//============================================================================== //==============================================================================
@@ -127,4 +130,6 @@ bool FileOutputStream::writeRepeatedByte (uint8 byte, size_t numBytes)
} }
return OutputStream::writeRepeatedByte (byte, numBytes); return OutputStream::writeRepeatedByte (byte, numBytes);
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
#ifndef BEAST_FILEOUTPUTSTREAM_H_INCLUDED #ifndef BEAST_FILEOUTPUTSTREAM_H_INCLUDED
#define BEAST_FILEOUTPUTSTREAM_H_INCLUDED #define BEAST_FILEOUTPUTSTREAM_H_INCLUDED
@@ -107,4 +110,6 @@ private:
ssize_t writeInternal (const void*, size_t); ssize_t writeInternal (const void*, size_t);
}; };
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
FileSearchPath::FileSearchPath() FileSearchPath::FileSearchPath()
{ {
} }
@@ -164,3 +167,5 @@ bool FileSearchPath::isFileInPath (const File& fileToCheck,
return false; return false;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_FILESEARCHPATH_H_INCLUDED #ifndef BEAST_FILESEARCHPATH_H_INCLUDED
#define BEAST_FILESEARCHPATH_H_INCLUDED #define BEAST_FILESEARCHPATH_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Encapsulates a set of folders that make up a search path. Encapsulates a set of folders that make up a search path.
@@ -155,4 +158,6 @@ private:
void init (const String& path); void init (const String& path);
}; };
} // namespace beast
#endif // BEAST_FILESEARCHPATH_H_INCLUDED #endif // BEAST_FILESEARCHPATH_H_INCLUDED

View File

@@ -24,6 +24,8 @@
#ifndef BEAST_MEMORYMAPPEDFILE_H_INCLUDED #ifndef BEAST_MEMORYMAPPEDFILE_H_INCLUDED
#define BEAST_MEMORYMAPPEDFILE_H_INCLUDED #define BEAST_MEMORYMAPPEDFILE_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
@@ -104,5 +106,6 @@ private:
void openInternal (const File&, AccessMode); void openInternal (const File&, AccessMode);
}; };
} // namespace beast
#endif // BEAST_MEMORYMAPPEDFILE_H_INCLUDED #endif // BEAST_MEMORYMAPPEDFILE_H_INCLUDED

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
RandomAccessFile::RandomAccessFile () noexcept RandomAccessFile::RandomAccessFile () noexcept
: fileHandle (nullptr) : fileHandle (nullptr)
, currentPosition (0) , currentPosition (0)
@@ -270,3 +273,5 @@ private:
}; };
static RandomAccessFileTests randomAccessFileTests; static RandomAccessFileTests randomAccessFileTests;
} // namespace beast

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_RANDOMACCESSFILE_H_INCLUDED #ifndef BEAST_RANDOMACCESSFILE_H_INCLUDED
#define BEAST_RANDOMACCESSFILE_H_INCLUDED #define BEAST_RANDOMACCESSFILE_H_INCLUDED
namespace beast
{
/** Provides random access reading and writing to an operating system file. /** Provides random access reading and writing to an operating system file.
This class wraps the underlying native operating system routines for This class wraps the underlying native operating system routines for
@@ -191,5 +194,7 @@ private:
FileOffset currentPosition; FileOffset currentPosition;
}; };
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
static File createTempFile (const File& parentDirectory, String name, static File createTempFile (const File& parentDirectory, String name,
const String& suffix, const int optionFlags) const String& suffix, const int optionFlags)
{ {
@@ -110,3 +113,5 @@ bool TemporaryFile::deleteTemporaryFile() const
return false; return false;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_TEMPORARYFILE_H_INCLUDED #ifndef BEAST_TEMPORARYFILE_H_INCLUDED
#define BEAST_TEMPORARYFILE_H_INCLUDED #define BEAST_TEMPORARYFILE_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Manages a temporary file, which will be deleted when this object is deleted. Manages a temporary file, which will be deleted when this object is deleted.
@@ -158,4 +161,6 @@ private:
const File temporaryFile, targetFile; const File temporaryFile, targetFile;
}; };
} // namespace beast
#endif // BEAST_TEMPORARYFILE_H_INCLUDED #endif // BEAST_TEMPORARYFILE_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
class JSONParser class JSONParser
{ {
public: public:
@@ -640,3 +643,5 @@ public:
}; };
static JSONTests jsonTests; static JSONTests jsonTests;
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_JSON_H_INCLUDED #ifndef BEAST_JSON_H_INCLUDED
#define BEAST_JSON_H_INCLUDED #define BEAST_JSON_H_INCLUDED
namespace beast
{
class InputStream; class InputStream;
class OutputStream; class OutputStream;
class File; class File;
@@ -106,5 +109,6 @@ private:
JSON(); // This class can't be instantiated - just use its static methods. JSON(); // This class can't be instantiated - just use its static methods.
}; };
} // namespace beast
#endif // BEAST_JSON_H_INCLUDED #endif // BEAST_JSON_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
FileLogger::FileLogger (const File& file, FileLogger::FileLogger (const File& file,
const String& welcomeMessage, const String& welcomeMessage,
const int64 maxInitialFileSizeBytes) const int64 maxInitialFileSizeBytes)
@@ -127,3 +130,5 @@ FileLogger* FileLogger::createDateStampedLogger (const String& logFileSubDirecto
.getNonexistentSibling(), .getNonexistentSibling(),
welcomeMessage, 0); welcomeMessage, 0);
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_FILELOGGER_H_INCLUDED #ifndef BEAST_FILELOGGER_H_INCLUDED
#define BEAST_FILELOGGER_H_INCLUDED #define BEAST_FILELOGGER_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
A simple implementation of a Logger that writes to a file. A simple implementation of a Logger that writes to a file.
@@ -126,5 +129,6 @@ private:
void trimFileSize (int64 maxFileSizeBytes) const; void trimFileSize (int64 maxFileSizeBytes) const;
}; };
} // namespace beast
#endif // BEAST_FILELOGGER_H_INCLUDED #endif // BEAST_FILELOGGER_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
Logger::Logger() {} Logger::Logger() {}
Logger::~Logger() Logger::~Logger()
@@ -56,3 +59,5 @@ void logAssertion (const char* const filename, const int lineNum) noexcept
#endif #endif
} }
#endif #endif
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_LOGGER_H_INCLUDED #ifndef BEAST_LOGGER_H_INCLUDED
#define BEAST_LOGGER_H_INCLUDED #define BEAST_LOGGER_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Acts as an application-wide logging class. Acts as an application-wide logging class.
@@ -87,5 +90,6 @@ private:
static Logger* currentLogger; static Logger* currentLogger;
}; };
} // namespace beast
#endif // BEAST_LOGGER_H_INCLUDED #endif // BEAST_LOGGER_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
namespace namespace
{ {
inline size_t bitToIndex (const int bit) noexcept { return (size_t) (bit >> 5); } inline size_t bitToIndex (const int bit) noexcept { return (size_t) (bit >> 5); }
@@ -1014,3 +1017,5 @@ void BigInteger::loadFromMemoryBlock (const MemoryBlock& data)
for (int i = (int) data.getSize(); --i >= 0;) for (int i = (int) data.getSize(); --i >= 0;)
this->setBitRangeAsInt (i << 3, 8, (uint32) data [i]); this->setBitRangeAsInt (i << 3, 8, (uint32) data [i]);
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_BIGINTEGER_H_INCLUDED #ifndef BEAST_BIGINTEGER_H_INCLUDED
#define BEAST_BIGINTEGER_H_INCLUDED #define BEAST_BIGINTEGER_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
An arbitrarily large integer class. An arbitrarily large integer class.
@@ -318,5 +321,6 @@ OutputStream& BEAST_CALLTYPE operator<< (OutputStream& stream, const BigInteger&
typedef BigInteger BitArray; typedef BigInteger BitArray;
#endif #endif
} // namespace beast
#endif // BEAST_BIGINTEGER_H_INCLUDED #endif // BEAST_BIGINTEGER_H_INCLUDED

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_MATH_H_INCLUDED #ifndef BEAST_MATH_H_INCLUDED
#define BEAST_MATH_H_INCLUDED #define BEAST_MATH_H_INCLUDED
namespace beast
{
// //
// Miscellaneous mathematical calculations // Miscellaneous mathematical calculations
// //
@@ -81,4 +84,6 @@ inline T radiansToDegrees (U radians)
return deg; return deg;
} }
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
Random::Random (const int64 seedValue) noexcept Random::Random (const int64 seedValue) noexcept
: seed (seedValue) : seed (seedValue)
{ {
@@ -185,3 +188,5 @@ public:
}; };
static RandomTests randomTests; static RandomTests randomTests;
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_RANDOM_H_INCLUDED #ifndef BEAST_RANDOM_H_INCLUDED
#define BEAST_RANDOM_H_INCLUDED #define BEAST_RANDOM_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
A random number generator. A random number generator.
@@ -129,5 +132,6 @@ private:
int64 seed; int64 seed;
}; };
} // namespace beast
#endif // BEAST_RANDOM_H_INCLUDED #endif // BEAST_RANDOM_H_INCLUDED

View File

@@ -25,6 +25,9 @@
#define BEAST_RANGE_H_INCLUDED #define BEAST_RANGE_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** A general-purpose range object, that simply represents any linear range with /** A general-purpose range object, that simply represents any linear range with
a start and end point. a start and end point.
@@ -255,5 +258,6 @@ private:
ValueType start, end; ValueType start, end;
}; };
} // namespace beast
#endif // BEAST_RANGE_H_INCLUDED #endif // BEAST_RANGE_H_INCLUDED

View File

@@ -25,6 +25,9 @@
// //
#define GLOBAL_PADDING_ENABLED 1 #define GLOBAL_PADDING_ENABLED 1
namespace beast
{
namespace CacheLine namespace CacheLine
{ {
@@ -412,6 +415,8 @@ private:
T m_t; T m_t;
}; };
} } // namespace CacheLine
} // namespace beast
#endif #endif

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_MEMORYALIGNMENT_H_INCLUDED #ifndef BEAST_MEMORYALIGNMENT_H_INCLUDED
#define BEAST_MEMORYALIGNMENT_H_INCLUDED #define BEAST_MEMORYALIGNMENT_H_INCLUDED
namespace beast
{
namespace Memory namespace Memory
{ {
@@ -62,6 +65,8 @@ inline P* pointerAdjustedForAlignment (P* const p)
bytesNeededForAlignment (p)); bytesNeededForAlignment (p));
} }
} } // namespace Memory
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
MemoryBlock::MemoryBlock() noexcept MemoryBlock::MemoryBlock() noexcept
: size (0) : size (0)
{ {
@@ -402,4 +405,6 @@ bool MemoryBlock::fromBase64Encoding (const String& s)
} }
return true; return true;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_MEMORYBLOCK_H_INCLUDED #ifndef BEAST_MEMORYBLOCK_H_INCLUDED
#define BEAST_MEMORYBLOCK_H_INCLUDED #define BEAST_MEMORYBLOCK_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
A class to hold a resizable block of raw data. A class to hold a resizable block of raw data.
@@ -264,5 +267,7 @@ private:
size_t size; size_t size;
}; };
} // namespace beast
#endif #endif

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED #ifndef BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED
#define BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED #define BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
Holds a pointer to an object which can optionally be deleted when this pointer Holds a pointer to an object which can optionally be deleted when this pointer
@@ -176,5 +179,6 @@ private:
bool shouldDelete; bool shouldDelete;
}; };
} // namespace beast
#endif // BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED #endif // BEAST_OPTIONALSCOPEDPOINTER_H_INCLUDED

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_SHAREDSINGLETON_H_INCLUDED #ifndef BEAST_SHAREDSINGLETON_H_INCLUDED
#define BEAST_SHAREDSINGLETON_H_INCLUDED #define BEAST_SHAREDSINGLETON_H_INCLUDED
namespace beast
{
/** Thread-safe singleton which comes into existence on first use. Use this /** Thread-safe singleton which comes into existence on first use. Use this
instead of creating objects with static storage duration. These singletons instead of creating objects with static storage duration. These singletons
are automatically reference counted, so if you hold a pointer to it in every are automatically reference counted, so if you hold a pointer to it in every
@@ -190,4 +193,6 @@ private:
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
} // namespace beast
#endif #endif

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
Main* Main::s_instance; Main* Main::s_instance;
Main::Main () Main::Main ()
@@ -124,3 +127,5 @@ int Main::runFromMain (int argc, char const* const* argv)
return exitCode; return exitCode;
} }
} // namespace beast

View File

@@ -20,6 +20,9 @@
#ifndef BEAST_CORE_MAIN_H_INCLUDED #ifndef BEAST_CORE_MAIN_H_INCLUDED
#define BEAST_CORE_MAIN_H_INCLUDED #define BEAST_CORE_MAIN_H_INCLUDED
namespace beast
{
/** Represents a command line program's entry point /** Represents a command line program's entry point
To use this, derive your class from @ref Main and implement the To use this, derive your class from @ref Main and implement the
function run (); function run ();
@@ -75,5 +78,7 @@ private:
static Main* s_instance; static Main* s_instance;
}; };
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
Result::Result() noexcept {} Result::Result() noexcept {}
Result::Result (const String& message) noexcept Result::Result (const String& message) noexcept
@@ -76,3 +79,5 @@ bool Result::wasOk() const noexcept { return errorMessage.isEmpty(); }
Result::operator bool() const noexcept { return errorMessage.isEmpty(); } Result::operator bool() const noexcept { return errorMessage.isEmpty(); }
bool Result::failed() const noexcept { return errorMessage.isNotEmpty(); } bool Result::failed() const noexcept { return errorMessage.isNotEmpty(); }
bool Result::operator!() const noexcept { return errorMessage.isNotEmpty(); } bool Result::operator!() const noexcept { return errorMessage.isNotEmpty(); }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_RESULT_H_INCLUDED #ifndef BEAST_RESULT_H_INCLUDED
#define BEAST_RESULT_H_INCLUDED #define BEAST_RESULT_H_INCLUDED
namespace beast
{
/** Represents the 'success' or 'failure' of an operation, and holds an associated /** Represents the 'success' or 'failure' of an operation, and holds an associated
error message to describe the error when there's a failure. error message to describe the error when there's a failure.
@@ -113,5 +116,7 @@ private:
operator void*() const; operator void*() const;
}; };
} // namespace beast
#endif #endif

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
namespace namespace
{ {
int64 getRandomSeedFromMACAddresses() int64 getRandomSeedFromMACAddresses()
@@ -107,3 +110,5 @@ Uuid& Uuid::operator= (const uint8* const rawData) noexcept
return *this; return *this;
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_UUID_H_INCLUDED #ifndef BEAST_UUID_H_INCLUDED
#define BEAST_UUID_H_INCLUDED #define BEAST_UUID_H_INCLUDED
namespace beast
{
//============================================================================== //==============================================================================
/** /**
A universally unique 128-bit identifier. A universally unique 128-bit identifier.
@@ -100,5 +103,6 @@ private:
uint8 uuid[16]; uint8 uuid[16];
}; };
} // namespace beast
#endif // BEAST_UUID_H_INCLUDED #endif // BEAST_UUID_H_INCLUDED

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_WINDOWSREGISTRY_H_INCLUDED #ifndef BEAST_WINDOWSREGISTRY_H_INCLUDED
#define BEAST_WINDOWSREGISTRY_H_INCLUDED #define BEAST_WINDOWSREGISTRY_H_INCLUDED
namespace beast
{
#if BEAST_WINDOWS || DOXYGEN #if BEAST_WINDOWS || DOXYGEN
/** /**
@@ -115,4 +118,7 @@ private:
}; };
#endif #endif
} // namespace beast
#endif // BEAST_WINDOWSREGISTRY_H_INCLUDED #endif // BEAST_WINDOWSREGISTRY_H_INCLUDED

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
bool File::copyInternal (const File& dest) const bool File::copyInternal (const File& dest) const
{ {
FileInputStream in (*this); FileInputStream in (*this);
@@ -233,3 +236,5 @@ bool Process::openDocument (const String& fileName, const String& parameters)
void File::revealToUser() const void File::revealToUser() const
{ {
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_ANDROID_JNIHELPERS_H_INCLUDED #ifndef BEAST_ANDROID_JNIHELPERS_H_INCLUDED
#define BEAST_ANDROID_JNIHELPERS_H_INCLUDED #define BEAST_ANDROID_JNIHELPERS_H_INCLUDED
namespace beast
{
#if ! (defined (BEAST_ANDROID_ACTIVITY_CLASSNAME) && defined (BEAST_ANDROID_ACTIVITY_CLASSPATH)) #if ! (defined (BEAST_ANDROID_ACTIVITY_CLASSNAME) && defined (BEAST_ANDROID_ACTIVITY_CLASSPATH))
#error "The BEAST_ANDROID_ACTIVITY_CLASSNAME and BEAST_ANDROID_ACTIVITY_CLASSPATH macros must be set!" #error "The BEAST_ANDROID_ACTIVITY_CLASSNAME and BEAST_ANDROID_ACTIVITY_CLASSPATH macros must be set!"
#endif #endif
@@ -397,4 +400,6 @@ DECLARE_JNI_CLASS (Matrix, "android/graphics/Matrix");
DECLARE_JNI_CLASS (RectClass, "android/graphics/Rect"); DECLARE_JNI_CLASS (RectClass, "android/graphics/Rect");
#undef JNI_CLASS_MEMBERS #undef JNI_CLASS_MEMBERS
} // namespace beast
#endif // BEAST_ANDROID_JNIHELPERS_H_INCLUDED #endif // BEAST_ANDROID_JNIHELPERS_H_INCLUDED

View File

@@ -21,7 +21,12 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
void Logger::outputDebugString (const String& text) void Logger::outputDebugString (const String& text)
{ {
__android_log_print (ANDROID_LOG_INFO, "BEAST", "%", text.toUTF8().getAddress()); __android_log_print (ANDROID_LOG_INFO, "BEAST", "%", text.toUTF8().getAddress());
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
//============================================================================== //==============================================================================
#define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \ #define JNI_CLASS_MEMBERS(METHOD, STATICMETHOD, FIELD, STATICFIELD) \
METHOD (constructor, "<init>", "()V") \ METHOD (constructor, "<init>", "()V") \
@@ -57,3 +60,5 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress,
// TODO // TODO
return false; return false;
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
JNIClassBase::JNIClassBase (const char* classPath_) JNIClassBase::JNIClassBase (const char* classPath_)
: classPath (classPath_), classRef (0) : classPath (classPath_), classRef (0)
{ {
@@ -299,3 +302,5 @@ bool Time::setSystemTimeToThisTime() const
bassertfalse; bassertfalse;
return false; return false;
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
/* /*
Note that a lot of methods that you'd expect to find in this file actually Note that a lot of methods that you'd expect to find in this file actually
live in beast_posix_SharedCode.h! live in beast_posix_SharedCode.h!
@@ -69,3 +72,5 @@ BEAST_API bool BEAST_CALLTYPE Process::isRunningUnderDebugger()
void Process::raisePrivilege() {} void Process::raisePrivilege() {}
void Process::lowerPrivilege() {} void Process::lowerPrivilege() {}
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
enum enum
{ {
U_ISOFS_SUPER_MAGIC = 5, U_ISOFS_SUPER_MAGIC = 5,
@@ -367,3 +370,5 @@ void File::revealToUser() const
else if (getParentDirectory().exists()) else if (getParentDirectory().exists())
getParentDirectory().startAsProcess(); getParentDirectory().startAsProcess();
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
void MACAddress::findAllAddresses (Array<MACAddress>& result) void MACAddress::findAllAddresses (Array<MACAddress>& result)
{ {
ifaddrs* addrs = nullptr; ifaddrs* addrs = nullptr;
@@ -57,3 +60,5 @@ bool Process::openEmailWithAttachments (const String& /* targetEmailAddress */,
return false; return false;
} }
} // namespace beast

View File

@@ -52,6 +52,9 @@
* *
*/ */
namespace beast
{
#define SI_LOAD_SHIFT 16 #define SI_LOAD_SHIFT 16
struct sysinfo { struct sysinfo {
long uptime; /* Seconds since boot */ long uptime; /* Seconds since boot */
@@ -349,3 +352,5 @@ bool Time::setSystemTimeToThisTime() const
return settimeofday (&t, 0) == 0; return settimeofday (&t, 0) == 0;
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
/* /*
Note that a lot of methods that you'd expect to find in this file actually Note that a lot of methods that you'd expect to find in this file actually
live in beast_posix_SharedCode.h! live in beast_posix_SharedCode.h!
@@ -67,3 +70,5 @@ static void swapUserAndEffectiveUser()
void Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); } void Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); }
void Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); } void Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
enum enum
{ {
U_ISOFS_SUPER_MAGIC = 0x9660, // linux/iso_fs.h U_ISOFS_SUPER_MAGIC = 0x9660, // linux/iso_fs.h
@@ -367,3 +370,5 @@ void File::revealToUser() const
else if (getParentDirectory().exists()) else if (getParentDirectory().exists())
getParentDirectory().startAsProcess(); getParentDirectory().startAsProcess();
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
void MACAddress::findAllAddresses (Array<MACAddress>& result) void MACAddress::findAllAddresses (Array<MACAddress>& result)
{ {
const int s = socket (AF_INET, SOCK_DGRAM, 0); const int s = socket (AF_INET, SOCK_DGRAM, 0);
@@ -59,3 +62,5 @@ bool Process::openEmailWithAttachments (const String& /* targetEmailAddress */,
return false; return false;
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
void Logger::outputDebugString (const String& text) void Logger::outputDebugString (const String& text)
{ {
std::cerr << text << std::endl; std::cerr << text << std::endl;
@@ -174,3 +177,5 @@ bool Time::setSystemTimeToThisTime() const
return settimeofday (&t, 0) == 0; return settimeofday (&t, 0) == 0;
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
/* /*
Note that a lot of methods that you'd expect to find in this file actually Note that a lot of methods that you'd expect to find in this file actually
live in beast_posix_SharedCode.h! live in beast_posix_SharedCode.h!
@@ -78,3 +81,5 @@ static void swapUserAndEffectiveUser()
void Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); } void Process::raisePrivilege() { if (geteuid() != 0 && getuid() == 0) swapUserAndEffectiveUser(); }
void Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); } void Process::lowerPrivilege() { if (geteuid() == 0 && getuid() != 0) swapUserAndEffectiveUser(); }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
/* /*
Note that a lot of methods that you'd expect to find in this file actually Note that a lot of methods that you'd expect to find in this file actually
live in beast_posix_SharedCode.h! live in beast_posix_SharedCode.h!
@@ -477,3 +480,5 @@ void File::addToDock() const
} }
} }
#endif #endif
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
void MACAddress::findAllAddresses (Array<MACAddress>& result) void MACAddress::findAllAddresses (Array<MACAddress>& result)
{ {
ifaddrs* addrs = nullptr; ifaddrs* addrs = nullptr;
@@ -95,3 +98,5 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress,
} }
#endif #endif
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
String String::fromCFString (CFStringRef cfString) String String::fromCFString (CFStringRef cfString)
{ {
if (cfString == 0) if (cfString == 0)
@@ -89,3 +92,5 @@ String String::convertToPrecomposedUnicode() const
return result; return result;
#endif #endif
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
ScopedAutoReleasePool::ScopedAutoReleasePool() ScopedAutoReleasePool::ScopedAutoReleasePool()
{ {
pool = [[NSAutoreleasePool alloc] init]; pool = [[NSAutoreleasePool alloc] init];
@@ -289,3 +292,5 @@ int SystemStats::getPageSize()
{ {
return (int) NSPageSize(); return (int) NSPageSize();
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
/* /*
Note that a lot of methods that you'd expect to find in this file actually Note that a lot of methods that you'd expect to find in this file actually
live in beast_posix_SharedCode.h! live in beast_posix_SharedCode.h!
@@ -79,3 +82,5 @@ BEAST_API bool BEAST_CALLTYPE Process::isRunningUnderDebugger()
{ {
return beast_isRunningUnderDebugger(); return beast_isRunningUnderDebugger();
} }
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_OSX_OBJCHELPERS_H_INCLUDED #ifndef BEAST_OSX_OBJCHELPERS_H_INCLUDED
#define BEAST_OSX_OBJCHELPERS_H_INCLUDED #define BEAST_OSX_OBJCHELPERS_H_INCLUDED
namespace beast
{
/* This file contains a few helper functions that are used internally but which /* This file contains a few helper functions that are used internally but which
need to be kept away from the public headers because they use obj-C symbols. need to be kept away from the public headers because they use obj-C symbols.
*/ */
@@ -146,5 +149,6 @@ private:
} }
}; };
} // namespace beast
#endif // BEAST_OSX_OBJCHELPERS_H_INCLUDED #endif // BEAST_OSX_OBJCHELPERS_H_INCLUDED

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
//#pragma message(BEAST_FILEANDLINE_ "Missing platform-specific implementation") //#pragma message(BEAST_FILEANDLINE_ "Missing platform-specific implementation")
FPUFlags FPUFlags::getCurrent () FPUFlags FPUFlags::getCurrent ()
@@ -27,3 +30,5 @@ FPUFlags FPUFlags::getCurrent ()
void FPUFlags::setCurrent (const FPUFlags& flags) void FPUFlags::setCurrent (const FPUFlags& flags)
{ {
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
CriticalSection::CriticalSection() noexcept CriticalSection::CriticalSection() noexcept
{ {
pthread_mutexattr_t atts; pthread_mutexattr_t atts;
@@ -1207,3 +1210,5 @@ private:
#endif #endif
} }
}; };
} // namespace beast

View File

@@ -24,6 +24,9 @@
#ifndef BEAST_WIN32_COMSMARTPTR_H_INCLUDED #ifndef BEAST_WIN32_COMSMARTPTR_H_INCLUDED
#define BEAST_WIN32_COMSMARTPTR_H_INCLUDED #define BEAST_WIN32_COMSMARTPTR_H_INCLUDED
namespace beast
{
#ifndef _MSC_VER #ifndef _MSC_VER
template<typename Type> struct UUIDGetter { static CLSID get() { bassertfalse; return CLSID(); } }; template<typename Type> struct UUIDGetter { static CLSID get() { bassertfalse; return CLSID(); } };
#define __uuidof(x) UUIDGetter<x>::get() #define __uuidof(x) UUIDGetter<x>::get()
@@ -162,4 +165,6 @@ public:
} }
}; };
} // namespace beast
#endif // BEAST_WIN32_COMSMARTPTR_H_INCLUDED #endif // BEAST_WIN32_COMSMARTPTR_H_INCLUDED

View File

@@ -17,6 +17,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
FPUFlags FPUFlags::getCurrent () FPUFlags FPUFlags::getCurrent ()
{ {
unsigned int currentControl; unsigned int currentControl;
@@ -174,3 +177,5 @@ void FPUFlags::setCurrent (const FPUFlags& flags)
if (result != 0) if (result != 0)
Throw (std::runtime_error ("error in _controlfp_s")); Throw (std::runtime_error ("error in _controlfp_s"));
} }
} // namespace beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
#ifndef INVALID_FILE_ATTRIBUTES #ifndef INVALID_FILE_ATTRIBUTES
#define INVALID_FILE_ATTRIBUTES ((DWORD) -1) #define INVALID_FILE_ATTRIBUTES ((DWORD) -1)
#endif #endif
@@ -883,3 +886,5 @@ void File::revealToUser() const
} }
} }
} }
} // beast

View File

@@ -21,6 +21,9 @@
*/ */
//============================================================================== //==============================================================================
namespace beast
{
struct GetAdaptersInfoHelper struct GetAdaptersInfoHelper
{ {
bool callGetAdaptersInfo() bool callGetAdaptersInfo()
@@ -152,3 +155,5 @@ bool Process::openEmailWithAttachments (const String& targetEmailAddress,
return mapiSendMail (0, 0, &message, MAPI_DIALOG | MAPI_LOGON_UI, 0) == SUCCESS_SUCCESS; return mapiSendMail (0, 0, &message, MAPI_DIALOG | MAPI_LOGON_UI, 0) == SUCCESS_SUCCESS;
} }
} // namespace beast

Some files were not shown because too many files have changed in this diff Show More