diff --git a/cplusplus/VError.cpp b/cplusplus/VError.cpp index 67e67348..a3d82188 100644 --- a/cplusplus/VError.cpp +++ b/cplusplus/VError.cpp @@ -32,8 +32,6 @@ #endif /*HAVE_CONFIG_H*/ #include -#include - #include VIPS_NAMESPACE_START diff --git a/cplusplus/VImage.cpp b/cplusplus/VImage.cpp index 3c1acd98..205b46cb 100644 --- a/cplusplus/VImage.cpp +++ b/cplusplus/VImage.cpp @@ -563,7 +563,7 @@ VImage::new_from_file( const char *name, VOption *options ) } VImage -VImage::new_from_buffer( void *buf, size_t len, const char *option_string, +VImage::new_from_buffer( const void *buf, size_t len, const char *option_string, VOption *options ) { const char *operation_name; @@ -588,6 +588,13 @@ VImage::new_from_buffer( void *buf, size_t len, const char *option_string, return( out ); } +VImage +VImage::new_from_buffer( const std::string &buf, const char *option_string, + VOption *options ) +{ + return( new_from_buffer( buf.c_str(), buf.size(), option_string, options ) ); +} + VImage VImage::new_matrix( int width, int height ) { diff --git a/cplusplus/include/vips/VError8.h b/cplusplus/include/vips/VError8.h index 627222c1..29f3e9fb 100644 --- a/cplusplus/include/vips/VError8.h +++ b/cplusplus/include/vips/VError8.h @@ -31,8 +31,8 @@ #ifndef VIPS_VERROR_H #define VIPS_VERROR_H -#include -#include +#include +#include #include #include @@ -43,7 +43,7 @@ class VIPS_CPLUSPLUS_API VError : public std::exception { std::string _what; public: - VError( std::string what ) : _what( what ) {} + VError( const std::string &what ) : _what( what ) {} VError() : _what( vips_error_buffer() ) {} virtual ~VError() throw() {} diff --git a/cplusplus/include/vips/VImage8.h b/cplusplus/include/vips/VImage8.h index c9e3471f..2416ae18 100644 --- a/cplusplus/include/vips/VImage8.h +++ b/cplusplus/include/vips/VImage8.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include @@ -470,7 +470,10 @@ public: return( VImage( image ) ); } - static VImage new_from_buffer( void *buf, size_t len, + static VImage new_from_buffer( const void *buf, size_t len, + const char *option_string, VOption *options = 0 ); + + static VImage new_from_buffer( const std::string &buf, const char *option_string, VOption *options = 0 ); static VImage new_matrix( int width, int height ); diff --git a/cplusplus/include/vips/VInterpolate8.h b/cplusplus/include/vips/VInterpolate8.h index 606a696a..8ef6f99e 100644 --- a/cplusplus/include/vips/VInterpolate8.h +++ b/cplusplus/include/vips/VInterpolate8.h @@ -34,7 +34,7 @@ #include #include -#include +#include #include