Fixed Doxyfile.

Changed in String class: toStr to ToStr and fromString to FromString ( since everthing else starts with uppercase characters ).
Added BitOp static class, just some helpers for bit operations.
This commit is contained in:
spartanj@gmail.com
2012-12-02 23:34:32 -03:00
parent 4ea3cdb9ef
commit 810272e101
45 changed files with 184 additions and 155 deletions

View File

@@ -127,7 +127,7 @@ class EE_API String {
/** Converts from any basic type to std::string */
template <class T>
static std::string toStr(const T& i) {
static std::string ToStr(const T& i) {
std::ostringstream ss;
ss << i;
return ss.str();
@@ -135,14 +135,14 @@ class EE_API String {
/** Converts from a string to type */
template <class T>
static bool fromString(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) {
static bool FromString(T& t, const std::string& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) {
std::istringstream iss(s);
return !(iss >> f >> t).fail();
}
/** Converts from a String to type */
template <class T>
static bool fromString(T& t, const String& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) {
static bool FromString(T& t, const String& s, std::ios_base& (*f)(std::ios_base&) = std::dec ) {
std::istringstream iss( s.ToUtf8() );
return !(iss >> f >> t).fail();
}

View File

@@ -8,7 +8,7 @@
#include <eepp/math/math.hpp>
using namespace EE::Math;
#include <eepp/system/utils.hpp>
#include <eepp/system/bitop.hpp>
#include <eepp/system/colors.hpp>
#include <eepp/system/ciostream.hpp>
#include <eepp/system/ciostreamfile.hpp>

View File

@@ -248,7 +248,7 @@
using namespace EE::Math;
#include <eepp/system/colors.hpp>
#include <eepp/system/utils.hpp>
#include <eepp/system/bitop.hpp>
#include <eepp/system/ctimeelapsed.hpp>
#include <eepp/system/tsingleton.hpp>
#include <eepp/system/clog.hpp>

42
include/eepp/system/bitop.hpp Executable file
View File

@@ -0,0 +1,42 @@
#ifndef EE_SYSTEMCUTILS_H
#define EE_SYSTEMCUTILS_H
#include <eepp/declares.hpp>
namespace EE { namespace System {
class BitOp {
public:
/** Write a bit into the Key in the position defined.
* @param Key The Key to write
* @param Pos The Position of the bit
* @param BitWrite 0 for write 0, any other to write 1.
*/
static inline void WriteBitKey( unsigned int * Key, unsigned int Pos, unsigned int BitWrite ) {
( BitWrite ) ? ( * Key ) |= ( 1 << Pos ) : ( * Key ) &= ~( 1 << Pos );
}
/** Read a bit from a 32 bit key, in the position defined
* @param Key The Key to read
* @param Pos The Position in the key to read
* @return True if the bit is 1
*/
static inline bool ReadBitKey( Uint32 * Key, Uint32 Pos ) {
return 0 != ( ( * Key ) & ( 1 << Pos ) );
}
/** Write a bit flag value
* @param Key The Key to write or remove
* @param Val The Value to write or remove
* @param BitWrite 0 to remove, any value to write
*/
static inline void SetBitFlagValue( Uint32 * Key, Uint32 Val, Uint32 BitWrite ) {
( BitWrite ) ? ( * Key ) |= Val : ( * Key ) &= ~Val;
}
};
}
}
#endif

View File

@@ -13,10 +13,10 @@ class EE_API cTimeElapsed : private cTimer {
~cTimeElapsed();
/** Time elapsed between this call and the last call to Elapsed() */
/** Time in milliseconds elapsed between this call and the last call to Elapsed() */
eeDouble Elapsed();
/** Time elapsed between the last Reset ( First Reset is when the class is instantiated ) */
/** Time in milliseconds elapsed between the last Reset ( First Reset is when the class is instantiated ) */
eeDouble ElapsedSinceStart();
/** Restart the initial counter. ( set it as now ) */

View File

@@ -13,7 +13,7 @@ class EE_API Sys {
/** @return A storage path for config files for every platform */
static std::string GetStoragePath( std::string appname );
/** @return The number of milliseconds since the EE++ library initialization. Note that this value wraps if the program runs for more than ~49 days. */
/** @return The number of milliseconds since the first call. Note that this value wraps if the program runs for more than ~49 days. */
static Uint32 GetTicks();
/** Wait a specified number of milliseconds before returning. */

View File

@@ -2,7 +2,6 @@
#define EE_SYSTEMTRESOURCEMANAGER_HPP
#include <eepp/system/base.hpp>
#include <eepp/system/utils.hpp>
#include <list>
namespace EE { namespace System {
@@ -98,7 +97,7 @@ T * tResourceManager<T>::Add( T * Resource ) {
while ( Count( Resource->Id() ) ) {
c++;
Resource->Name( RealName + String::toStr( c ) );
Resource->Name( RealName + String::ToStr( c ) );
}
return Add( Resource );

View File

@@ -1,34 +0,0 @@
#ifndef EE_SYSTEMCUTILS_H
#define EE_SYSTEMCUTILS_H
#include <eepp/declares.hpp>
namespace EE { namespace System {
/** Write a bit into the Key in the position defined.
* @param Key The Key to write
* @param Pos The Position of the bit
* @param BitWrite 0 for write 0, any other to write 1.
*/
inline void Write32BitKey( unsigned int * Key, unsigned int Pos, unsigned int BitWrite ) {
( BitWrite ) ? ( * Key ) |= ( 1 << Pos ) : ( * Key ) &= ~( 1 << Pos );
}
/** Read a bit from a 32 bit key, in the position defined
* @param Key The Key to read
* @param Pos The Position in the key to read
* @return True if the bit is 1
*/
inline bool Read32BitKey( Uint32 * Key, Uint32 Pos ) {
return 0 != ( ( * Key ) & ( 1 << Pos ) );
}
/** Write a 32 bit flag value */
inline void SetFlagValue( Uint32 * Key, Uint32 Val, Uint32 BitWrite ) {
( BitWrite ) ? ( * Key ) |= Val : ( * Key ) &= ~Val;
}
}
}
#endif

View File

@@ -11,7 +11,7 @@
#include <eepp/math/math.hpp>
using namespace EE::Math;
#include <eepp/system/utils.hpp>
#include <eepp/system/bitop.hpp>
#include <eepp/system/colors.hpp>
#include <eepp/system/tsingleton.hpp>
#include <eepp/system/sys.hpp>

View File

@@ -8,7 +8,7 @@
using namespace EE::Math;
#include <eepp/system/colors.hpp>
#include <eepp/system/utils.hpp>
#include <eepp/system/bitop.hpp>
#include <eepp/system/ctimeelapsed.hpp>
#include <eepp/system/tsingleton.hpp>
#include <eepp/system/clog.hpp>