Mercurial > hg > orthanc
changeset 3992:f9863630ec7f
working on the shared library for Orthanc framework
line wrap: on
line diff
--- a/Core/ChunkedBuffer.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/ChunkedBuffer.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,12 +33,15 @@ #pragma once +#include "OrthancFramework.h" + +#include <boost/noncopyable.hpp> #include <list> #include <string> namespace Orthanc { - class ChunkedBuffer + class ORTHANC_PUBLIC ChunkedBuffer : public boost::noncopyable { private: typedef std::list<std::string*> Chunks;
--- a/Core/Compression/DeflateBaseCompressor.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Compression/DeflateBaseCompressor.h Fri Jun 05 16:07:01 2020 +0200 @@ -48,7 +48,7 @@ namespace Orthanc { - class DeflateBaseCompressor : public IBufferCompressor + class ORTHANC_PUBLIC DeflateBaseCompressor : public IBufferCompressor { private: uint8_t compressionLevel_;
--- a/Core/Compression/GzipCompressor.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Compression/GzipCompressor.h Fri Jun 05 16:07:01 2020 +0200 @@ -37,7 +37,7 @@ namespace Orthanc { - class GzipCompressor : public DeflateBaseCompressor + class ORTHANC_PUBLIC GzipCompressor : public DeflateBaseCompressor { private: uint64_t GuessUncompressedSize(const void* compressed,
--- a/Core/Compression/HierarchicalZipWriter.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Compression/HierarchicalZipWriter.h Fri Jun 05 16:07:01 2020 +0200 @@ -45,7 +45,7 @@ namespace Orthanc { - class HierarchicalZipWriter + class ORTHANC_PUBLIC HierarchicalZipWriter : public boost::noncopyable { #if ORTHANC_BUILD_UNIT_TESTS == 1 FRIEND_TEST(HierarchicalZipWriter, Index);
--- a/Core/Compression/IBufferCompressor.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Compression/IBufferCompressor.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,12 +33,14 @@ #pragma once +#include "../OrthancFramework.h" + #include <string> #include <boost/noncopyable.hpp> namespace Orthanc { - class IBufferCompressor : public boost::noncopyable + class ORTHANC_PUBLIC IBufferCompressor : public boost::noncopyable { public: virtual ~IBufferCompressor()
--- a/Core/Compression/ZipWriter.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Compression/ZipWriter.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "../OrthancFramework.h" + #if !defined(ORTHANC_ENABLE_ZLIB) # error The macro ORTHANC_ENABLE_ZLIB must be defined #endif @@ -44,11 +46,12 @@ #include <stdint.h> #include <string> +#include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> namespace Orthanc { - class ZipWriter + class ORTHANC_PUBLIC ZipWriter : public boost::noncopyable { private: struct PImpl;
--- a/Core/Compression/ZlibCompressor.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Compression/ZlibCompressor.h Fri Jun 05 16:07:01 2020 +0200 @@ -37,7 +37,7 @@ namespace Orthanc { - class ZlibCompressor : public DeflateBaseCompressor + class ORTHANC_PUBLIC ZlibCompressor : public DeflateBaseCompressor { public: ZlibCompressor()
--- a/Core/DicomFormat/DicomArray.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomFormat/DicomArray.h Fri Jun 05 16:07:01 2020 +0200 @@ -40,7 +40,7 @@ namespace Orthanc { - class DicomArray : public boost::noncopyable + class ORTHANC_PUBLIC DicomArray : public boost::noncopyable { private: typedef std::vector<DicomElement*> Elements;
--- a/Core/DicomFormat/DicomElement.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomFormat/DicomElement.h Fri Jun 05 16:07:01 2020 +0200 @@ -38,7 +38,7 @@ namespace Orthanc { - class DicomElement : public boost::noncopyable + class ORTHANC_PUBLIC DicomElement : public boost::noncopyable { private: DicomTag tag_;
--- a/Core/DicomFormat/DicomImageInformation.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomFormat/DicomImageInformation.h Fri Jun 05 16:07:01 2020 +0200 @@ -39,7 +39,7 @@ namespace Orthanc { - class DicomImageInformation + class ORTHANC_PUBLIC DicomImageInformation { private: unsigned int width_;
--- a/Core/DicomFormat/DicomMap.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomFormat/DicomMap.h Fri Jun 05 16:07:01 2020 +0200 @@ -43,7 +43,7 @@ namespace Orthanc { - class DicomMap : public boost::noncopyable + class ORTHANC_PUBLIC DicomMap : public boost::noncopyable { public: typedef std::map<DicomTag, DicomValue*> Content;
--- a/Core/DicomFormat/DicomValue.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomFormat/DicomValue.h Fri Jun 05 16:07:01 2020 +0200 @@ -46,7 +46,7 @@ namespace Orthanc { - class DicomValue : public boost::noncopyable + class ORTHANC_PUBLIC DicomValue : public boost::noncopyable { private: enum Type
--- a/Core/DicomParsing/DcmtkTranscoder.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomParsing/DcmtkTranscoder.h Fri Jun 05 16:07:01 2020 +0200 @@ -45,7 +45,7 @@ namespace Orthanc { - class DcmtkTranscoder : public IDicomTranscoder + class ORTHANC_PUBLIC DcmtkTranscoder : public IDicomTranscoder { private: unsigned int lossyQuality_;
--- a/Core/DicomParsing/FromDcmtkBridge.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomParsing/FromDcmtkBridge.h Fri Jun 05 16:07:01 2020 +0200 @@ -70,7 +70,7 @@ namespace Orthanc { - class FromDcmtkBridge : public boost::noncopyable + class ORTHANC_PUBLIC FromDcmtkBridge : public boost::noncopyable { #if ORTHANC_BUILD_UNIT_TESTS == 1 FRIEND_TEST(FromDcmtkBridge, FromJson);
--- a/Core/DicomParsing/IDicomTranscoder.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomParsing/IDicomTranscoder.h Fri Jun 05 16:07:01 2020 +0200 @@ -43,14 +43,13 @@ namespace Orthanc { + class ParsedDicomFile; + /** * WARNING: This class might be called from several threads at * once. Make sure to implement proper locking. **/ - - class ParsedDicomFile; - - class IDicomTranscoder : public boost::noncopyable + class ORTHANC_PUBLIC IDicomTranscoder : public boost::noncopyable { public: class DicomImage : public boost::noncopyable
--- a/Core/DicomParsing/ParsedDicomFile.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/DicomParsing/ParsedDicomFile.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "../OrthancFramework.h" + #if !defined(ORTHANC_ENABLE_JPEG) # error Macro ORTHANC_ENABLE_JPEG must be defined to use this file #endif @@ -79,7 +81,7 @@ namespace Orthanc { - class ParsedDicomFile : public IDynamicObject + class ORTHANC_PUBLIC ParsedDicomFile : public IDynamicObject { private: struct PImpl;
--- a/Core/Enumerations.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Enumerations.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "OrthancFramework.h" + #include <string> @@ -805,97 +807,97 @@ }; - const char* EnumerationToString(ErrorCode code); + const char* EnumerationToString(ErrorCode code) ORTHANC_PUBLIC; - const char* EnumerationToString(HttpMethod method); + const char* EnumerationToString(HttpMethod method) ORTHANC_PUBLIC; - const char* EnumerationToString(HttpStatus status); + const char* EnumerationToString(HttpStatus status) ORTHANC_PUBLIC; - const char* EnumerationToString(ResourceType type); + const char* EnumerationToString(ResourceType type) ORTHANC_PUBLIC; - const char* EnumerationToString(ImageFormat format); + const char* EnumerationToString(ImageFormat format) ORTHANC_PUBLIC; - const char* EnumerationToString(Encoding encoding); + const char* EnumerationToString(Encoding encoding) ORTHANC_PUBLIC; - const char* EnumerationToString(PhotometricInterpretation photometric); + const char* EnumerationToString(PhotometricInterpretation photometric) ORTHANC_PUBLIC; - const char* EnumerationToString(LogLevel level); + const char* EnumerationToString(LogLevel level) ORTHANC_PUBLIC; - const char* EnumerationToString(RequestOrigin origin); + const char* EnumerationToString(RequestOrigin origin) ORTHANC_PUBLIC; - const char* EnumerationToString(PixelFormat format); + const char* EnumerationToString(PixelFormat format) ORTHANC_PUBLIC; - const char* EnumerationToString(ModalityManufacturer manufacturer); + const char* EnumerationToString(ModalityManufacturer manufacturer) ORTHANC_PUBLIC; - const char* EnumerationToString(DicomRequestType type); + const char* EnumerationToString(DicomRequestType type) ORTHANC_PUBLIC; - const char* EnumerationToString(TransferSyntax syntax); + const char* EnumerationToString(TransferSyntax syntax) ORTHANC_PUBLIC; - const char* EnumerationToString(DicomVersion version); + const char* EnumerationToString(DicomVersion version) ORTHANC_PUBLIC; - const char* EnumerationToString(ValueRepresentation vr); + const char* EnumerationToString(ValueRepresentation vr) ORTHANC_PUBLIC; - const char* EnumerationToString(JobState state); + const char* EnumerationToString(JobState state) ORTHANC_PUBLIC; - const char* EnumerationToString(MimeType mime); + const char* EnumerationToString(MimeType mime) ORTHANC_PUBLIC; - const char* EnumerationToString(Endianness endianness); + const char* EnumerationToString(Endianness endianness) ORTHANC_PUBLIC; - const char* EnumerationToString(StorageCommitmentFailureReason reason); + const char* EnumerationToString(StorageCommitmentFailureReason reason) ORTHANC_PUBLIC; - Encoding StringToEncoding(const char* encoding); + Encoding StringToEncoding(const char* encoding) ORTHANC_PUBLIC; - ResourceType StringToResourceType(const char* type); + ResourceType StringToResourceType(const char* type) ORTHANC_PUBLIC; - ImageFormat StringToImageFormat(const char* format); + ImageFormat StringToImageFormat(const char* format) ORTHANC_PUBLIC; - LogLevel StringToLogLevel(const char* level); + LogLevel StringToLogLevel(const char* level) ORTHANC_PUBLIC; ValueRepresentation StringToValueRepresentation(const std::string& vr, - bool throwIfUnsupported); + bool throwIfUnsupported) ORTHANC_PUBLIC; - PhotometricInterpretation StringToPhotometricInterpretation(const char* value); + PhotometricInterpretation StringToPhotometricInterpretation(const char* value) ORTHANC_PUBLIC; - ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer); + ModalityManufacturer StringToModalityManufacturer(const std::string& manufacturer) ORTHANC_PUBLIC; - DicomVersion StringToDicomVersion(const std::string& version); + DicomVersion StringToDicomVersion(const std::string& version) ORTHANC_PUBLIC; - JobState StringToJobState(const std::string& state); + JobState StringToJobState(const std::string& state) ORTHANC_PUBLIC; - RequestOrigin StringToRequestOrigin(const std::string& origin); + RequestOrigin StringToRequestOrigin(const std::string& origin) ORTHANC_PUBLIC; - MimeType StringToMimeType(const std::string& mime); + MimeType StringToMimeType(const std::string& mime) ORTHANC_PUBLIC; - unsigned int GetBytesPerPixel(PixelFormat format); + unsigned int GetBytesPerPixel(PixelFormat format) ORTHANC_PUBLIC; bool GetDicomEncoding(Encoding& encoding, - const char* specificCharacterSet); + const char* specificCharacterSet) ORTHANC_PUBLIC; - ResourceType GetChildResourceType(ResourceType type); + ResourceType GetChildResourceType(ResourceType type) ORTHANC_PUBLIC; - ResourceType GetParentResourceType(ResourceType type); + ResourceType GetParentResourceType(ResourceType type) ORTHANC_PUBLIC; bool IsResourceLevelAboveOrEqual(ResourceType level, - ResourceType reference); + ResourceType reference) ORTHANC_PUBLIC; - DicomModule GetModule(ResourceType type); + DicomModule GetModule(ResourceType type) ORTHANC_PUBLIC; - const char* GetDicomSpecificCharacterSet(Encoding encoding); + const char* GetDicomSpecificCharacterSet(Encoding encoding) ORTHANC_PUBLIC; - HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error); + HttpStatus ConvertErrorCodeToHttpStatus(ErrorCode error) ORTHANC_PUBLIC; - bool IsUserContentType(FileContentType type); + bool IsUserContentType(FileContentType type) ORTHANC_PUBLIC; - bool IsBinaryValueRepresentation(ValueRepresentation vr); + bool IsBinaryValueRepresentation(ValueRepresentation vr) ORTHANC_PUBLIC; - Encoding GetDefaultDicomEncoding(); + Encoding GetDefaultDicomEncoding() ORTHANC_PUBLIC; - void SetDefaultDicomEncoding(Encoding encoding); + void SetDefaultDicomEncoding(Encoding encoding) ORTHANC_PUBLIC; - const char* GetTransferSyntaxUid(DicomTransferSyntax syntax); + const char* GetTransferSyntaxUid(DicomTransferSyntax syntax) ORTHANC_PUBLIC; - bool IsRetiredTransferSyntax(DicomTransferSyntax syntax); + bool IsRetiredTransferSyntax(DicomTransferSyntax syntax) ORTHANC_PUBLIC; bool LookupTransferSyntax(DicomTransferSyntax& target, - const std::string& uid); + const std::string& uid) ORTHANC_PUBLIC; }
--- a/Core/Exports.h Fri May 29 21:23:57 2020 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/** - * Orthanc - A Lightweight, RESTful DICOM Store - * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics - * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium - * - * This program is free software: you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * In addition, as a special exception, the copyright holders of this - * program give permission to link the code of its release with the - * OpenSSL project's "OpenSSL" library (or with modified versions of it - * that use the same license as the "OpenSSL" library), and distribute - * the linked executables. You must obey the GNU General Public License - * in all respects for all of the code used other than "OpenSSL". If you - * modify file(s) with this exception, you may extend this exception to - * your version of the file(s), but you are not obligated to do so. If - * you do not wish to do so, delete this exception statement from your - * version. If you delete this exception statement from all source files - * in the program, then also delete it here. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - **/ - - -#pragma once - - -//#define ORTHANC_PUBLIC __attribute__ ((visibility ("default"))) -#define ORTHANC_PUBLIC - -#if 0 // Test for the shared library - -// https://gcc.gnu.org/wiki/Visibility -#if defined(_WIN32) || defined (__CYGWIN__) -# if !defined(BUILDING_ORTHANC_FRAMEWORK) -# error Macro BUILDING_ORTHANC_FRAMEWORK must be defined -# elif BUILDING_ORTHANC_FRAMEWORK == 1 -# define ORTHANC_PUBLIC __declspec(dllexport) -# else -# define ORTHANC_PUBLIC __declspec(dllimport) -# endif -# define ORTHANC_LOCAL -#else -# if __GNUC__ >= 4 -# define ORTHANC_PUBLIC __attribute__ ((visibility ("default"))) -# define ORTHANC_LOCAL __attribute__ ((visibility ("hidden"))) -# else -# define ORTHANC_PUBLIC -# define ORTHANC_LOCAL -# pragma warning Unknown dynamic link import/export semantics -# endif -#endif - -#endif
--- a/Core/FileBuffer.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/FileBuffer.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,12 +33,14 @@ #pragma once +#include "OrthancFramework.h" + #if !defined(ORTHANC_SANDBOXED) # error The macro ORTHANC_SANDBOXED must be defined #endif #if ORTHANC_SANDBOXED == 1 -# error The namespace SystemToolbox cannot be used in sandboxed environments +# error The class FileBuffer cannot be used in sandboxed environments #endif #include <boost/noncopyable.hpp> @@ -47,7 +49,7 @@ namespace Orthanc { - class FileBuffer : public boost::noncopyable + class ORTHANC_PUBLIC FileBuffer : public boost::noncopyable { private: class PImpl;
--- a/Core/HttpClient.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpClient.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,8 +33,8 @@ #pragma once -#include "Exports.h" #include "Enumerations.h" +#include "OrthancFramework.h" #include "WebServiceParameters.h" #include <string>
--- a/Core/HttpServer/BufferHttpSender.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/BufferHttpSender.h Fri Jun 05 16:07:01 2020 +0200 @@ -36,7 +36,7 @@ namespace Orthanc { - class BufferHttpSender : public HttpFileSender + class ORTHANC_PUBLIC BufferHttpSender : public HttpFileSender { private: std::string buffer_;
--- a/Core/HttpServer/FilesystemHttpSender.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/FilesystemHttpSender.h Fri Jun 05 16:07:01 2020 +0200 @@ -40,7 +40,7 @@ namespace Orthanc { - class FilesystemHttpSender : public HttpFileSender + class ORTHANC_PUBLIC FilesystemHttpSender : public HttpFileSender { private: std::ifstream file_;
--- a/Core/HttpServer/HttpContentNegociation.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/HttpContentNegociation.h Fri Jun 05 16:07:01 2020 +0200 @@ -32,6 +32,7 @@ #pragma once +#include "../OrthancFramework.h" #include "../Compatibility.h" #include <memory> @@ -45,7 +46,7 @@ namespace Orthanc { - class HttpContentNegociation : public boost::noncopyable + class ORTHANC_PUBLIC HttpContentNegociation : public boost::noncopyable { public: typedef std::map<std::string, std::string> HttpHeaders;
--- a/Core/HttpServer/HttpFileSender.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/HttpFileSender.h Fri Jun 05 16:07:01 2020 +0200 @@ -37,7 +37,7 @@ namespace Orthanc { - class HttpFileSender : public IHttpStreamAnswer + class ORTHANC_PUBLIC HttpFileSender : public IHttpStreamAnswer { private: std::string contentType_;
--- a/Core/HttpServer/HttpOutput.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/HttpOutput.h Fri Jun 05 16:07:01 2020 +0200 @@ -45,7 +45,7 @@ namespace Orthanc { - class HttpOutput : public boost::noncopyable + class ORTHANC_PUBLIC HttpOutput : public boost::noncopyable { private: typedef std::list< std::pair<std::string, std::string> > Header;
--- a/Core/HttpServer/HttpServer.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/HttpServer.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,9 @@ #pragma once +// To have ORTHANC_ENABLE_xxx defined if using the shared library +#include "../OrthancFramework.h" + #if !defined(ORTHANC_ENABLE_MONGOOSE) # error Macro ORTHANC_ENABLE_MONGOOSE must be defined to include this file #endif @@ -74,7 +77,7 @@ }; - class HttpServer + class ORTHANC_PUBLIC HttpServer : public boost::noncopyable { private: // http://stackoverflow.com/questions/311166/stdauto-ptr-or-boostshared-ptr-for-pimpl-idiom
--- a/Core/HttpServer/HttpStreamTranscoder.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/HttpStreamTranscoder.h Fri Jun 05 16:07:01 2020 +0200 @@ -41,7 +41,7 @@ namespace Orthanc { - class HttpStreamTranscoder : public IHttpStreamAnswer + class ORTHANC_PUBLIC HttpStreamTranscoder : public IHttpStreamAnswer { private: IHttpStreamAnswer& source_;
--- a/Core/HttpServer/HttpToolbox.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/HttpToolbox.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,11 +33,12 @@ #pragma once +#include "../OrthancFramework.h" #include "IHttpHandler.h" namespace Orthanc { - class HttpToolbox + class ORTHANC_PUBLIC HttpToolbox : public boost::noncopyable { public: static void ParseGetArguments(IHttpHandler::GetArguments& result,
--- a/Core/HttpServer/MultipartStreamReader.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/MultipartStreamReader.h Fri Jun 05 16:07:01 2020 +0200 @@ -40,7 +40,7 @@ namespace Orthanc { - class MultipartStreamReader : public boost::noncopyable + class ORTHANC_PUBLIC MultipartStreamReader : public boost::noncopyable { public: typedef std::map<std::string, std::string> HttpHeaders;
--- a/Core/HttpServer/StringMatcher.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/HttpServer/StringMatcher.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "../OrthancFramework.h" + #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> #include <string> @@ -40,7 +42,7 @@ namespace Orthanc { // Convenience class that wraps a Boost algorithm for string matching - class StringMatcher : public boost::noncopyable + class ORTHANC_PUBLIC StringMatcher : public boost::noncopyable { public: typedef std::string::const_iterator Iterator;
--- a/Core/Images/Font.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Images/Font.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,9 @@ #pragma once +// To have ORTHANC_HAS_EMBEDDED_RESOURCES defined if using the shared library +#include "../OrthancFramework.h" + #if !defined(ORTHANC_HAS_EMBEDDED_RESOURCES) # error Macro ORTHANC_HAS_EMBEDDED_RESOURCES must be defined #endif @@ -50,7 +53,7 @@ namespace Orthanc { - class Font : public boost::noncopyable + class ORTHANC_PUBLIC Font : public boost::noncopyable { private: struct Character
--- a/Core/Images/FontRegistry.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Images/FontRegistry.h Fri Jun 05 16:07:01 2020 +0200 @@ -45,7 +45,7 @@ namespace Orthanc { - class FontRegistry : public boost::noncopyable + class ORTHANC_PUBLIC FontRegistry : public boost::noncopyable { private: typedef std::vector<Font*> Fonts;
--- a/Core/Images/Image.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Images/Image.h Fri Jun 05 16:07:01 2020 +0200 @@ -38,7 +38,7 @@ namespace Orthanc { - class Image : public ImageAccessor + class ORTHANC_PUBLIC Image : public ImageAccessor { private: ImageBuffer image_;
--- a/Core/Images/ImageAccessor.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Images/ImageAccessor.h Fri Jun 05 16:07:01 2020 +0200 @@ -41,7 +41,7 @@ namespace Orthanc { - class ImageAccessor : public boost::noncopyable + class ORTHANC_PUBLIC ImageAccessor : public boost::noncopyable { private: template <Orthanc::PixelFormat Format>
--- a/Core/Images/ImageBuffer.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Images/ImageBuffer.h Fri Jun 05 16:07:01 2020 +0200 @@ -41,7 +41,7 @@ namespace Orthanc { - class ImageBuffer : public boost::noncopyable + class ORTHANC_PUBLIC ImageBuffer : public boost::noncopyable { private: bool changed_;
--- a/Core/Images/ImageProcessing.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Images/ImageProcessing.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,22 +33,26 @@ #pragma once +#include "../OrthancFramework.h" + #include "ImageAccessor.h" #include <vector> #include <stdint.h> #include <algorithm> +#include <boost/noncopyable.hpp> namespace Orthanc { - namespace ImageProcessing + class ORTHANC_PUBLIC ImageProcessing : public boost::noncopyable { + public: class ImagePoint { int32_t x_; int32_t y_; - public: + public: ImagePoint(int32_t x, int32_t y) : x_(x), y_(y) @@ -76,117 +80,118 @@ double GetDistanceToLine(double a, double b, double c) const; // where ax + by + c = 0 is the equation of the line }; - void Copy(ImageAccessor& target, - const ImageAccessor& source); + static void Copy(ImageAccessor& target, + const ImageAccessor& source); - void Convert(ImageAccessor& target, - const ImageAccessor& source); + static void Convert(ImageAccessor& target, + const ImageAccessor& source); - void ApplyWindowing_Deprecated(ImageAccessor& target, - const ImageAccessor& source, - float windowCenter, - float windowWidth, - float rescaleSlope, - float rescaleIntercept, - bool invert); + static void ApplyWindowing_Deprecated(ImageAccessor& target, + const ImageAccessor& source, + float windowCenter, + float windowWidth, + float rescaleSlope, + float rescaleIntercept, + bool invert); - void Set(ImageAccessor& image, - int64_t value); + static void Set(ImageAccessor& image, + int64_t value); - void Set(ImageAccessor& image, - uint8_t red, - uint8_t green, - uint8_t blue, - uint8_t alpha); + static void Set(ImageAccessor& image, + uint8_t red, + uint8_t green, + uint8_t blue, + uint8_t alpha); - void Set(ImageAccessor& image, - uint8_t red, - uint8_t green, - uint8_t blue, - ImageAccessor& alpha); + static void Set(ImageAccessor& image, + uint8_t red, + uint8_t green, + uint8_t blue, + ImageAccessor& alpha); - void ShiftRight(ImageAccessor& target, - unsigned int shift); + static void ShiftRight(ImageAccessor& target, + unsigned int shift); - void ShiftLeft(ImageAccessor& target, - unsigned int shift); + static void ShiftLeft(ImageAccessor& target, + unsigned int shift); - void GetMinMaxIntegerValue(int64_t& minValue, - int64_t& maxValue, - const ImageAccessor& image); + static void GetMinMaxIntegerValue(int64_t& minValue, + int64_t& maxValue, + const ImageAccessor& image); - void GetMinMaxFloatValue(float& minValue, - float& maxValue, - const ImageAccessor& image); + static void GetMinMaxFloatValue(float& minValue, + float& maxValue, + const ImageAccessor& image); - void AddConstant(ImageAccessor& image, - int64_t value); + static void AddConstant(ImageAccessor& image, + int64_t value); // "useRound" is expensive - void MultiplyConstant(ImageAccessor& image, - float factor, - bool useRound); + static void MultiplyConstant(ImageAccessor& image, + float factor, + bool useRound); // Computes "(x + offset) * scaling" inplace. "useRound" is expensive. - void ShiftScale(ImageAccessor& image, - float offset, - float scaling, - bool useRound); + static void ShiftScale(ImageAccessor& image, + float offset, + float scaling, + bool useRound); - void ShiftScale(ImageAccessor& target, - const ImageAccessor& source, - float offset, - float scaling, - bool useRound); + static void ShiftScale(ImageAccessor& target, + const ImageAccessor& source, + float offset, + float scaling, + bool useRound); + + static void Invert(ImageAccessor& image); + + static void Invert(ImageAccessor& image, int64_t maxValue); - void Invert(ImageAccessor& image); - - void Invert(ImageAccessor& image, int64_t maxValue); + static void DrawLineSegment(ImageAccessor& image, + int x0, + int y0, + int x1, + int y1, + int64_t value); - void DrawLineSegment(ImageAccessor& image, - int x0, - int y0, - int x1, - int y1, - int64_t value); + static void DrawLineSegment(ImageAccessor& image, + int x0, + int y0, + int x1, + int y1, + uint8_t red, + uint8_t green, + uint8_t blue, + uint8_t alpha); - void DrawLineSegment(ImageAccessor& image, - int x0, - int y0, - int x1, - int y1, - uint8_t red, - uint8_t green, - uint8_t blue, - uint8_t alpha); + static void FillPolygon(ImageAccessor& image, + const std::vector<ImagePoint>& points, + int64_t value); + + static void Resize(ImageAccessor& target, + const ImageAccessor& source); - void FillPolygon(ImageAccessor& image, - const std::vector<ImagePoint>& points, - int64_t value); + static ImageAccessor* Halve(const ImageAccessor& source, + bool forceMinimalPitch); - void Resize(ImageAccessor& target, - const ImageAccessor& source); + static void FlipX(ImageAccessor& image); - ImageAccessor* Halve(const ImageAccessor& source, - bool forceMinimalPitch); + static void FlipY(ImageAccessor& image); - void FlipX(ImageAccessor& image); - - void FlipY(ImageAccessor& image); + static void SeparableConvolution(ImageAccessor& image /* inplace */, + const std::vector<float>& horizontal, + size_t horizontalAnchor, + const std::vector<float>& vertical, + size_t verticalAnchor); - void SeparableConvolution(ImageAccessor& image /* inplace */, - const std::vector<float>& horizontal, - size_t horizontalAnchor, - const std::vector<float>& vertical, - size_t verticalAnchor); + static void SmoothGaussian5x5(ImageAccessor& image); - void SmoothGaussian5x5(ImageAccessor& image); - - void FitSize(ImageAccessor& target, - const ImageAccessor& source); + static void FitSize(ImageAccessor& target, + const ImageAccessor& source); - ImageAccessor* FitSize(const ImageAccessor& source, - unsigned int width, - unsigned int height); - } + static ImageAccessor* FitSize(const ImageAccessor& source, + unsigned int width, + unsigned int height); + }; } +
--- a/Core/Logging.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Logging.h Fri Jun 05 16:07:01 2020 +0200 @@ -29,8 +29,13 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. **/ + + #pragma once +// To have ORTHANC_ENABLE_LOGGING defined if using the shared library +#include "OrthancFramework.h" + #include <iostream> #if !defined(ORTHANC_ENABLE_LOGGING) @@ -64,28 +69,28 @@ namespace Logging { #if ORTHANC_ENABLE_LOGGING_PLUGIN == 1 - void Initialize(OrthancPluginContext* context); + void Initialize(OrthancPluginContext* context) ORTHANC_PUBLIC; #else - void Initialize(); + void Initialize() ORTHANC_PUBLIC; #endif - void Finalize(); + void Finalize() ORTHANC_PUBLIC; - void Reset(); + void Reset() ORTHANC_PUBLIC; - void Flush(); + void Flush() ORTHANC_PUBLIC; - void EnableInfoLevel(bool enabled); + void EnableInfoLevel(bool enabled) ORTHANC_PUBLIC; - void EnableTraceLevel(bool enabled); + void EnableTraceLevel(bool enabled) ORTHANC_PUBLIC; - bool IsTraceLevelEnabled(); + bool IsTraceLevelEnabled() ORTHANC_PUBLIC; - bool IsInfoLevelEnabled(); + bool IsInfoLevelEnabled() ORTHANC_PUBLIC; - void SetTargetFile(const std::string& path); + void SetTargetFile(const std::string& path) ORTHANC_PUBLIC; - void SetTargetFolder(const std::string& path); + void SetTargetFolder(const std::string& path) ORTHANC_PUBLIC; #if ORTHANC_ENABLE_LOGGING_STDIO == 1 typedef void (*LoggingFunction)(const char*); @@ -140,7 +145,7 @@ InternalLevel_TRACE }; - class InternalLogger : public boost::noncopyable + class ORTHANC_PUBLIC InternalLogger : public boost::noncopyable { private: InternalLevel level_; @@ -178,7 +183,7 @@ { namespace Logging { - class InternalLogger + class ORTHANC_PUBLIC InternalLogger { private: boost::mutex::scoped_lock lock_; @@ -212,7 +217,7 @@ This function is only to be used by tests. */ - LoggingMemento CreateLoggingMemento(); + LoggingMemento CreateLoggingMemento() ORTHANC_PUBLIC; /** Restores the logging configuration. The logging system is restored in @@ -224,7 +229,7 @@ This function is only to be used by tests. */ - void RestoreLoggingMemento(LoggingMemento memento); + void RestoreLoggingMemento(LoggingMemento memento) ORTHANC_PUBLIC; /** Call this function if you do not plan on restoring the logging @@ -232,7 +237,7 @@ This function is only to be used by tests. */ - void DiscardLoggingMemento(LoggingMemento memento); + void DiscardLoggingMemento(LoggingMemento memento) ORTHANC_PUBLIC; /** Set custom logging streams for the error, warning and info logs. @@ -248,7 +253,7 @@ */ void SetErrorWarnInfoLoggingStreams(std::ostream* errorStream, std::ostream* warningStream, - std::ostream* infoStream); + std::ostream* infoStream) ORTHANC_PUBLIC; #ifdef __EMSCRIPTEN__ /** @@ -260,7 +265,7 @@ logging levels to be correctly handled by the browser when the code executes in Web Assembly */ - void EnableEmscriptenLogging(); + void EnableEmscriptenLogging() ORTHANC_PUBLIC; #endif } }
--- a/Core/Lua/LuaContext.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Lua/LuaContext.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,9 @@ #pragma once +// To have ORTHANC_ENABLE_LUA defined if using the shared library +#include "../OrthancFramework.h" + #if !defined(ORTHANC_ENABLE_LUA) # error The macro ORTHANC_ENABLE_LUA must be defined #endif @@ -60,7 +63,7 @@ namespace Orthanc { - class LuaContext : public boost::noncopyable + class ORTHANC_PUBLIC LuaContext : public boost::noncopyable { private: friend class LuaFunctionCall;
--- a/Core/Lua/LuaFunctionCall.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Lua/LuaFunctionCall.h Fri Jun 05 16:07:01 2020 +0200 @@ -42,7 +42,7 @@ namespace Orthanc { - class LuaFunctionCall : public boost::noncopyable + class ORTHANC_PUBLIC LuaFunctionCall : public boost::noncopyable { private: LuaContext& context_;
--- a/Core/MetricsRegistry.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/MetricsRegistry.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "OrthancFramework.h" + #if !defined(ORTHANC_SANDBOXED) # error The macro ORTHANC_SANDBOXED must be defined #endif @@ -55,7 +57,7 @@ MetricsType_MinOver1Minute }; - class MetricsRegistry : public boost::noncopyable + class ORTHANC_PUBLIC MetricsRegistry : public boost::noncopyable { private: class Item;
--- a/Core/OrthancException.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/OrthancException.h Fri Jun 05 16:07:01 2020 +0200 @@ -35,8 +35,8 @@ #include "Compatibility.h" #include "Enumerations.h" -#include "Exports.h" #include "Logging.h" +#include "OrthancFramework.h" #include <stdint.h> #include <string>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Core/OrthancFramework.h Fri Jun 05 16:07:01 2020 +0200 @@ -0,0 +1,63 @@ +/** + * Orthanc - A Lightweight, RESTful DICOM Store + * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * Copyright (C) 2017-2020 Osimis S.A., Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * In addition, as a special exception, the copyright holders of this + * program give permission to link the code of its release with the + * OpenSSL project's "OpenSSL" library (or with modified versions of it + * that use the same license as the "OpenSSL" library), and distribute + * the linked executables. You must obey the GNU General Public License + * in all respects for all of the code used other than "OpenSSL". If you + * modify file(s) with this exception, you may extend this exception to + * your version of the file(s), but you are not obligated to do so. If + * you do not wish to do so, delete this exception statement from your + * version. If you delete this exception statement from all source files + * in the program, then also delete it here. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + **/ + + +#pragma once + +/** + * Besides the "pragma once" above that only protects this file, + * define a macro to prevent including different versions of + * "OrthancFramework.h" + **/ +#ifndef __ORTHANC_FRAMEWORK_H +#define __ORTHANC_FRAMEWORK_H + +/** + * It is implied that if this file is used, we're building the Orthanc + * framework (not using it): We don't use the common "BUILDING_DLL" + * construction. https://gcc.gnu.org/wiki/Visibility + **/ +#if defined(_WIN32) || defined (__CYGWIN__) +# define ORTHANC_PUBLIC __declspec(dllexport) +# define ORTHANC_LOCAL +#else +# if __GNUC__ >= 4 +# define ORTHANC_PUBLIC __attribute__((visibility ("default"))) +# define ORTHANC_LOCAL __attribute__((visibility ("hidden"))) +# else +# define ORTHANC_PUBLIC +# define ORTHANC_LOCAL +# pragma warning Unknown dynamic link import/export semantics +# endif +#endif + +#endif /* __ORTHANC_FRAMEWORK_H */
--- a/Core/RestApi/RestApiHierarchy.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/RestApi/RestApiHierarchy.h Fri Jun 05 16:07:01 2020 +0200 @@ -42,7 +42,7 @@ namespace Orthanc { - class RestApiHierarchy : public boost::noncopyable + class ORTHANC_PUBLIC RestApiHierarchy : public boost::noncopyable { public: class Resource : public boost::noncopyable
--- a/Core/RestApi/RestApiPath.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/RestApi/RestApiPath.h Fri Jun 05 16:07:01 2020 +0200 @@ -40,7 +40,7 @@ namespace Orthanc { - class RestApiPath + class ORTHANC_PUBLIC RestApiPath : public boost::noncopyable { private: UriComponents uri_;
--- a/Core/SQLite/Connection.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SQLite/Connection.h Fri Jun 05 16:07:01 2020 +0200 @@ -50,7 +50,7 @@ { namespace SQLite { - class Connection : NonCopyable + class ORTHANC_PUBLIC Connection : NonCopyable { friend class Statement; friend class Transaction;
--- a/Core/SQLite/FunctionContext.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SQLite/FunctionContext.h Fri Jun 05 16:07:01 2020 +0200 @@ -40,7 +40,7 @@ { namespace SQLite { - class FunctionContext : public NonCopyable + class ORTHANC_PUBLIC FunctionContext : public NonCopyable { friend class Connection;
--- a/Core/SQLite/Statement.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SQLite/Statement.h Fri Jun 05 16:07:01 2020 +0200 @@ -67,7 +67,7 @@ COLUMN_TYPE_NULL = 5 }; - class Statement : public NonCopyable + class ORTHANC_PUBLIC Statement : public NonCopyable { friend class Connection;
--- a/Core/SQLite/StatementId.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SQLite/StatementId.h Fri Jun 05 16:07:01 2020 +0200 @@ -37,11 +37,17 @@ #pragma once +#if ORTHANC_SQLITE_STANDALONE == 1 +# define ORTHANC_PUBLIC +#else +# include "../OrthancFramework.h" +#endif + namespace Orthanc { namespace SQLite { - class StatementId + class ORTHANC_PUBLIC StatementId { private: const char* file_;
--- a/Core/SQLite/StatementReference.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SQLite/StatementReference.h Fri Jun 05 16:07:01 2020 +0200 @@ -37,6 +37,12 @@ #pragma once +#if ORTHANC_SQLITE_STANDALONE == 1 +# define ORTHANC_PUBLIC +#else +# include "../OrthancFramework.h" +#endif + #include "NonCopyable.h" #include "SQLiteTypes.h" @@ -49,7 +55,7 @@ { namespace SQLite { - class StatementReference : NonCopyable + class ORTHANC_PUBLIC StatementReference : NonCopyable { private: StatementReference* root_; // Only used for non-root nodes
--- a/Core/SQLite/Transaction.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SQLite/Transaction.h Fri Jun 05 16:07:01 2020 +0200 @@ -44,7 +44,7 @@ { namespace SQLite { - class Transaction : public ITransaction + class ORTHANC_PUBLIC Transaction : public ITransaction { private: Connection& connection_;
--- a/Core/SerializationToolbox.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SerializationToolbox.h Fri Jun 05 16:07:01 2020 +0200 @@ -34,7 +34,7 @@ #pragma once #include "DicomFormat/DicomTag.h" -#include "Exports.h" +#include "OrthancFramework.h" #include <json/value.h> #include <list>
--- a/Core/SharedLibrary.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SharedLibrary.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "OrthancFramework.h" + #if !defined(ORTHANC_SANDBOXED) # error The macro ORTHANC_SANDBOXED must be defined #endif @@ -50,7 +52,7 @@ namespace Orthanc { - class SharedLibrary : public boost::noncopyable + class ORTHANC_PUBLIC SharedLibrary : public boost::noncopyable { public: #if defined(_WIN32)
--- a/Core/SystemToolbox.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/SystemToolbox.h Fri Jun 05 16:07:01 2020 +0200 @@ -42,7 +42,7 @@ #endif #include "Enumerations.h" -#include "Exports.h" +#include "OrthancFramework.h" #include <map> #include <vector>
--- a/Core/TemporaryFile.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/TemporaryFile.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "OrthancFramework.h" + #if !defined(ORTHANC_SANDBOXED) # error The macro ORTHANC_SANDBOXED must be defined #endif @@ -41,11 +43,12 @@ # error The class TemporaryFile cannot be used in sandboxed environments #endif +#include <boost/noncopyable.hpp> #include <string> namespace Orthanc { - class TemporaryFile + class ORTHANC_PUBLIC TemporaryFile : public boost::noncopyable { private: std::string path_;
--- a/Core/Toolbox.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/Toolbox.h Fri Jun 05 16:07:01 2020 +0200 @@ -34,7 +34,7 @@ #pragma once #include "Enumerations.h" -#include "Exports.h" +#include "OrthancFramework.h" #include <stdint.h> #include <vector>
--- a/Core/WebServiceParameters.h Fri May 29 21:23:57 2020 +0200 +++ b/Core/WebServiceParameters.h Fri Jun 05 16:07:01 2020 +0200 @@ -33,6 +33,8 @@ #pragma once +#include "OrthancFramework.h" + #if !defined(ORTHANC_SANDBOXED) # error The macro ORTHANC_SANDBOXED must be defined #endif @@ -44,7 +46,7 @@ namespace Orthanc { - class WebServiceParameters + class ORTHANC_PUBLIC WebServiceParameters { public: typedef std::map<std::string, std::string> Dictionary;
--- a/Resources/CMake/OrthancFrameworkConfiguration.cmake Fri May 29 21:23:57 2020 +0200 +++ b/Resources/CMake/OrthancFrameworkConfiguration.cmake Fri Jun 05 16:07:01 2020 +0200 @@ -264,12 +264,9 @@ -DORTHANC_ENABLE_CIVETWEB=1 -DORTHANC_ENABLE_MONGOOSE=0 ) + set(ORTHANC_ENABLE_CIVETWEB 1) else() include(${CMAKE_CURRENT_LIST_DIR}/MongooseConfiguration.cmake) - add_definitions( - -DORTHANC_ENABLE_CIVETWEB=0 - -DORTHANC_ENABLE_MONGOOSE=1 - ) endif() list(APPEND ORTHANC_CORE_SOURCES_INTERNAL @@ -292,6 +289,19 @@ ) endif() +if (ORTHANC_ENABLE_CIVETWEB) + add_definitions(-DORTHANC_ENABLE_CIVETWEB=1) +else() + add_definitions(-DORTHANC_ENABLE_CIVETWEB=0) +endif() + +if (ORTHANC_ENABLE_MONGOOSE) + add_definitions(-DORTHANC_ENABLE_MONGOOSE=1) +else() + add_definitions(-DORTHANC_ENABLE_MONGOOSE=0) +endif() + + ## ## JPEG support: libjpeg @@ -534,24 +544,20 @@ if (ORTHANC_SANDBOXED) add_definitions( -DORTHANC_SANDBOXED=1 - -DORTHANC_ENABLE_LOGGING_PLUGIN=0 ) if (CMAKE_SYSTEM_NAME STREQUAL "Emscripten") - add_definitions( - -DORTHANC_ENABLE_LOGGING=1 - -DORTHANC_ENABLE_LOGGING_STDIO=1 - ) + set(ORTHANC_ENABLE_LOGGING ON) + set(ORTHANC_ENABLE_LOGGING_STDIO ON) else() - add_definitions( - -DORTHANC_ENABLE_LOGGING=0 - ) + set(ORTHANC_ENABLE_LOGGING OFF) endif() else() + set(ORTHANC_ENABLE_LOGGING ON) + set(ORTHANC_ENABLE_LOGGING_STDIO OFF) + add_definitions( - -DORTHANC_ENABLE_LOGGING=1 - -DORTHANC_ENABLE_LOGGING_STDIO=0 -DORTHANC_SANDBOXED=0 ) @@ -577,6 +583,26 @@ endif() + +if (ORTHANC_ENABLE_LOGGING) + add_definitions(-DORTHANC_ENABLE_LOGGING=1) +else() + add_definitions(-DORTHANC_ENABLE_LOGGING=0) +endif() + +if (ORTHANC_ENABLE_LOGGING_PLUGIN) + add_definitions(-DORTHANC_ENABLE_LOGGING_PLUGIN=1) +else() + add_definitions(-DORTHANC_ENABLE_LOGGING_PLUGIN=0) +endif() + +if (ORTHANC_ENABLE_LOGGING_STDIO) + add_definitions(-DORTHANC_ENABLE_LOGGING_STDIO=1) +else() + add_definitions(-DORTHANC_ENABLE_LOGGING_STDIO=0) +endif() + + if (HAS_EMBEDDED_RESOURCES) add_definitions(-DORTHANC_HAS_EMBEDDED_RESOURCES=1)
--- a/Resources/CMake/SQLiteConfiguration.cmake Fri May 29 21:23:57 2020 +0200 +++ b/Resources/CMake/SQLiteConfiguration.cmake Fri Jun 05 16:07:01 2020 +0200 @@ -19,7 +19,7 @@ SET(SQLITE_MD5 "16717b26358ba81f0bfdac07addc77da") SET(SQLITE_URL "http://orthanc.osimis.io/ThirdPartyDownloads/sqlite-amalgamation-3270100.zip") - add_definitions(-DORTHANC_SQLITE_VERSION=3027001) + set(ORTHANC_SQLITE_VERSION 3027001) DownloadPackage(${SQLITE_MD5} ${SQLITE_URL} "${SQLITE_SOURCES_DIR}") @@ -59,16 +59,19 @@ string(REGEX REPLACE "#define SQLITE_VERSION_NUMBER(.*)$" "\\1" SQLITE_VERSION_NUMBER2 ${SQLITE_VERSION_NUMBER1}) # Remove the trailing spaces to convert the string to a proper integer - string(STRIP ${SQLITE_VERSION_NUMBER2} SQLITE_VERSION_NUMBER) + string(STRIP ${SQLITE_VERSION_NUMBER2} ORTHANC_SQLITE_VERSION) - message("Detected version of SQLite: ${SQLITE_VERSION_NUMBER}") + message("Detected version of SQLite: ${ORTHANC_SQLITE_VERSION}") - IF (${SQLITE_VERSION_NUMBER} LESS 3007000) + IF (${ORTHANC_SQLITE_VERSION} LESS 3007000) # "sqlite3_create_function_v2" is not defined in SQLite < 3.7.0 message(FATAL_ERROR "SQLite version must be above 3.7.0. Please set the CMake variable USE_SYSTEM_SQLITE to OFF.") ENDIF() - add_definitions(-DORTHANC_SQLITE_VERSION=${SQLITE_VERSION_NUMBER}) - link_libraries(sqlite3) endif() + + +add_definitions( + -DORTHANC_SQLITE_VERSION=${ORTHANC_SQLITE_VERSION} + )
--- a/UnitTestsSources/FrameworkTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/FrameworkTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "../Core/EnumerationDictionary.h"
--- a/UnitTestsSources/ImageProcessingTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/ImageProcessingTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"
--- a/UnitTestsSources/JpegLosslessTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/JpegLosslessTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"
--- a/UnitTestsSources/LoggingTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/LoggingTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -30,6 +30,11 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. **/ + +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h" #include <boost/regex.hpp>
--- a/UnitTestsSources/LuaTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/LuaTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h" @@ -48,13 +52,20 @@ TEST(Lua, Json) { Orthanc::LuaContext lua; + +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1 lua.Execute(Orthanc::EmbeddedResources::LUA_TOOLBOX); +#endif + lua.Execute("a={}"); lua.Execute("a['x'] = 10"); lua.Execute("a['y'] = {}"); lua.Execute("a['y'][1] = 20"); lua.Execute("a['y'][2] = 20"); + +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1 lua.Execute("PrintRecursive(a)"); +#endif lua.Execute("function f(a) print(a.bool) return a.bool,20,30,40,50,60 end"); @@ -72,11 +83,13 @@ o["z"] = 20.5f; v.append(o); +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1 { Orthanc::LuaFunctionCall f(lua, "PrintRecursive"); f.PushJson(v); f.Execute(); } +#endif { Orthanc::LuaFunctionCall f(lua, "f"); @@ -114,6 +127,7 @@ } +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1 TEST(Lua, Simple) { Orthanc::LuaContext lua; @@ -143,6 +157,7 @@ f.Execute(); } } +#endif TEST(Lua, ReturnJson)
--- a/UnitTestsSources/PluginsTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/PluginsTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,10 +31,14 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h" -#include "../../Core/OrthancException.h" +#include "../Core/OrthancException.h" #include "../Plugins/Engine/PluginsManager.h" using namespace Orthanc;
--- a/UnitTestsSources/RestApiTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/RestApiTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"
--- a/UnitTestsSources/SQLiteChromiumTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/SQLiteChromiumTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"
--- a/UnitTestsSources/SQLiteTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/SQLiteTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"
--- a/UnitTestsSources/StreamTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/StreamTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"
--- a/UnitTestsSources/ToolboxTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/ToolboxTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h" #include "../Core/Compatibility.h"
--- a/UnitTestsSources/VersionsTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/VersionsTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h" @@ -53,7 +57,8 @@ # include <openssl/opensslv.h> #endif -#if ORTHANC_ENABLE_CIVETWEB == 1 +#if (ORTHANC_ENABLE_CIVETWEB == 1 && \ + ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1) # include <civetweb.h> #endif @@ -113,7 +118,8 @@ } -#if ORTHANC_ENABLE_CIVETWEB == 1 +#if (ORTHANC_ENABLE_CIVETWEB == 1 && \ + ORTHANC_UNIT_TESTS_LINK_FRAMEWORK != 1) TEST(Version, CivetwebCompression) { ASSERT_TRUE(mg_check_feature(MG_FEATURES_COMPRESSION));
--- a/UnitTestsSources/ZipTests.cpp Fri May 29 21:23:57 2020 +0200 +++ b/UnitTestsSources/ZipTests.cpp Fri Jun 05 16:07:01 2020 +0200 @@ -31,6 +31,10 @@ **/ +#if ORTHANC_UNIT_TESTS_LINK_FRAMEWORK == 1 +# include <OrthancFramework/OrthancFramework.h> +#endif + #include "PrecompiledHeadersUnitTests.h" #include "gtest/gtest.h"