#ifndef __CPPLUGINS_CONFIG__H__
#define __CPPLUGINS_CONFIG__H__
+/*
+ * =========================================================================
+ * Some global values
+ * =========================================================================
+ */
+#define cpPlugins_PATHS "cpPlugins_PATHS"
+
/*
* =========================================================================
* ITK related macros
# define ITK_OVERRIDE
#endif // ITK_OVERRIDE
+/*
+ * =========================================================================
+ * VTK related macros
+ * =========================================================================
+ */
+#include <vtkConfigure.h>
+#ifndef VTK_OVERRIDE
+# define VTK_OVERRIDE
+#endif // VTK_OVERRIDE
+
/*
* =========================================================================
* Identify OS
# define cpPlugins_SYS_WINDOWS
# define cpPlugins_LIB_PREFIX ""
# define cpPlugins_LIB_EXT "dll"
+# define cpPlugins_SEPARATOR ";"
# ifndef WIN32_LEAN_AND_MEAN
# define WIN32_LEAN_AND_MEAN
# endif
# define cpPlugins_SYS_LINUX
# define cpPlugins_LIB_PREFIX "lib"
# define cpPlugins_LIB_EXT "so"
+# define cpPlugins_SEPARATOR ":"
#elif defined( __APPLE__ ) || defined( MACOSX ) || defined( macintosh ) || defined( Macintosh )
# define cpPlugins_SYS_MACOS
# define cpPlugins_LIB_PREFIX "lib"
# define cpPlugins_LIB_EXT "dylib"
+# define cpPlugins_SEPARATOR ":"
#elif defined( __FreeBSD__ ) || defined( __FreeBSD_kernel__ )
# define cpPlugins_SYS_FREEBSD
# define cpPlugins_LIB_PREFIX "lib"
# define cpPlugins_LIB_EXT "so"
+# define cpPlugins_SEPARATOR ":"
#else
# error "This operating system is not supported by cpPlugins"
#endif
* =========================================================================
*/
+#include <chrono>
#include <cstring>
#include <fstream>
#include <iostream>
#include <string>
+// -------------------------------------------------------------------------
#ifdef cpPlugins_SYS_WINDOWS
# define cpPlugins_STRTOK( A, B, N ) strtok_s( A, B, N )
#else // cpPlugins_SYS_WINDOWS
# define cpPlugins_STRTOK( A, B, N ) std::strtok( A, B )
#endif // cpPlugins_SYS_WINDOWS
+// -------------------------------------------------------------------------
+#define cpPlugins_CHRONO \
+ std::chrono::duration_cast< std::chrono::milliseconds >( \
+ std::chrono::system_clock::now( ).time_since_epoch( ) \
+ ).count( )
+
namespace cpPlugins
{
struct IsSeparator
};
// -----------------------------------------------------------------------
- inline bool IsBlank( const char& value )
+ inline bool IsBlank( const char& v )
{
- return( value == ' ' || value == '\t' || value == '\n' || value == '\r' );
+ return( v == ' ' || v == '\t' || v == '\n' || v == '\r' );
}
// -----------------------------------------------------------------------
}
// -----------------------------------------------------------------------
- inline bool ReadFileIntoString( std::string& buffer, const std::string& fname )
+ inline bool ReadFileIntoString(
+ std::string& buffer, const std::string& fname
+ )
{
buffer = "";
std::ifstream file_stream( fname.c_str( ) );