Mercurial > hg > orthanc
changeset 50:a15e90e5d6fc
rename in code
line wrap: on
line diff
--- a/Core/ChunkedBuffer.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/ChunkedBuffer.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <string.h> -namespace Palantir +namespace Palanthir { void ChunkedBuffer::Clear() {
--- a/Core/ChunkedBuffer.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/ChunkedBuffer.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,7 +23,7 @@ #include <list> #include <string> -namespace Palantir +namespace Palanthir { class ChunkedBuffer {
--- a/Core/Compression/BufferCompressor.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Compression/BufferCompressor.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,7 +20,7 @@ #include "BufferCompressor.h" -namespace Palantir +namespace Palanthir { void BufferCompressor::Compress(std::string& output, const std::vector<uint8_t>& input)
--- a/Core/Compression/BufferCompressor.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Compression/BufferCompressor.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <stdint.h> #include <vector> -namespace Palantir +namespace Palanthir { class BufferCompressor {
--- a/Core/Compression/ZlibCompressor.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Compression/ZlibCompressor.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,15 +23,15 @@ #include <stdio.h> #include <string.h> #include <zlib.h> -#include "../PalantirException.h" +#include "../PalanthirException.h" -namespace Palantir +namespace Palanthir { void ZlibCompressor::SetCompressionLevel(uint8_t level) { if (level >= 10) { - throw PalantirException("Zlib compression level must be between 0 (no compression) and 9 (highest compression"); + throw PalanthirException("Zlib compression level must be between 0 (no compression) and 9 (highest compression"); } } @@ -70,10 +70,10 @@ switch (error) { case Z_MEM_ERROR: - throw PalantirException(ErrorCode_NotEnoughMemory); + throw PalanthirException(ErrorCode_NotEnoughMemory); default: - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } } } @@ -91,7 +91,7 @@ if (compressedSize < sizeof(size_t)) { - throw PalantirException("Zlib: The compressed buffer is ill-formed"); + throw PalanthirException("Zlib: The compressed buffer is ill-formed"); } size_t uncompressedLength; @@ -112,13 +112,13 @@ switch (error) { case Z_DATA_ERROR: - throw PalantirException("Zlib: Corrupted or incomplete compressed buffer"); + throw PalanthirException("Zlib: Corrupted or incomplete compressed buffer"); case Z_MEM_ERROR: - throw PalantirException(ErrorCode_NotEnoughMemory); + throw PalanthirException(ErrorCode_NotEnoughMemory); default: - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } } }
--- a/Core/Compression/ZlibCompressor.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Compression/ZlibCompressor.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "BufferCompressor.h" -namespace Palantir +namespace Palanthir { class ZlibCompressor : public BufferCompressor {
--- a/Core/DicomFormat/DicomArray.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomArray.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include <stdio.h> -namespace Palantir +namespace Palanthir { DicomArray::DicomArray(const DicomMap& map) {
--- a/Core/DicomFormat/DicomArray.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomArray.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <vector> -namespace Palantir +namespace Palanthir { class DicomArray : public boost::noncopyable {
--- a/Core/DicomFormat/DicomElement.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomElement.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,7 +23,7 @@ #include "DicomValue.h" #include "DicomTag.h" -namespace Palantir +namespace Palanthir { class DicomElement : public boost::noncopyable {
--- a/Core/DicomFormat/DicomMap.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomMap.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,10 +23,10 @@ #include <stdio.h> #include <memory> #include "DicomString.h" -#include "../PalantirException.h" +#include "../PalanthirException.h" -namespace Palantir +namespace Palanthir { static DicomTag patientTags[] = { @@ -177,7 +177,7 @@ if (it == map_.end()) { - throw PalantirException("Inexistent tag"); + throw PalanthirException("Inexistent tag"); } else {
--- a/Core/DicomFormat/DicomMap.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomMap.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -27,7 +27,7 @@ #include <map> #include <json/json.h> -namespace Palantir +namespace Palanthir { class DicomMap : public boost::noncopyable {
--- a/Core/DicomFormat/DicomNullValue.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomNullValue.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "DicomValue.h" -namespace Palantir +namespace Palanthir { class DicomNullValue : public DicomValue {
--- a/Core/DicomFormat/DicomString.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomString.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "DicomValue.h" -namespace Palantir +namespace Palanthir { class DicomString : public DicomValue {
--- a/Core/DicomFormat/DicomTag.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomTag.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,13 +20,13 @@ #include "DicomTag.h" -#include "../PalantirException.h" +#include "../PalanthirException.h" #include <iostream> #include <iomanip> #include <stdio.h> -namespace Palantir +namespace Palanthir { bool DicomTag::operator< (const DicomTag& other) const {
--- a/Core/DicomFormat/DicomTag.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomTag.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <stdint.h> -namespace Palantir +namespace Palanthir { class DicomTag {
--- a/Core/DicomFormat/DicomValue.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/DicomFormat/DicomValue.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,7 +23,7 @@ #include <boost/noncopyable.hpp> #include <string> -namespace Palantir +namespace Palanthir { class DicomValue : public boost::noncopyable {
--- a/Core/Enumerations.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Enumerations.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,9 +20,9 @@ #pragma once -#include "../PalantirCppClient/HttpEnumerations.h" +#include "../PalanthirCppClient/HttpEnumerations.h" -namespace Palantir +namespace Palanthir { enum ErrorCode {
--- a/Core/FileStorage.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/FileStorage.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,13 +23,13 @@ // http://stackoverflow.com/questions/1576272/storing-large-number-of-files-in-file-system // http://stackoverflow.com/questions/446358/storing-a-large-number-of-images -#include "PalantirException.h" +#include "PalanthirException.h" #include "Toolbox.h" #include "Uuid.h" #include <boost/filesystem/fstream.hpp> -namespace Palantir +namespace Palanthir { boost::filesystem::path FileStorage::GetPath(const std::string& uuid) const { @@ -37,7 +37,7 @@ if (!Toolbox::IsUuid(uuid)) { - throw PalantirException(ErrorCode_ParameterOutOfRange); + throw PalanthirException(ErrorCode_ParameterOutOfRange); } fs::path path = root_; @@ -60,14 +60,14 @@ { if (!fs::is_directory(root)) { - throw PalantirException("The file storage root directory is a file"); + throw PalanthirException("The file storage root directory is a file"); } } else { if (!fs::create_directories(root)) { - throw PalantirException("Unable to create the file storage root directory"); + throw PalanthirException("Unable to create the file storage root directory"); } } } @@ -96,14 +96,14 @@ { if (!boost::filesystem::is_directory(path.parent_path())) { - throw PalantirException("The subdirectory to be created is already occupied by a regular file"); + throw PalanthirException("The subdirectory to be created is already occupied by a regular file"); } } else { if (!boost::filesystem::create_directories(path.parent_path())) { - throw PalantirException("Unable to create a subdirectory in the file storage"); + throw PalanthirException("Unable to create a subdirectory in the file storage"); } } @@ -111,7 +111,7 @@ f.open(path, std::ofstream::out | std::ios::binary); if (!f.good()) { - throw PalantirException("Unable to create a new file in the file storage"); + throw PalanthirException("Unable to create a new file in the file storage"); } if (size != 0) @@ -120,7 +120,7 @@ if (!f.good()) { f.close(); - throw PalantirException("Unable to write to the new file in the file storage"); + throw PalanthirException("Unable to write to the new file in the file storage"); } }
--- a/Core/FileStorage.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/FileStorage.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include "Compression/BufferCompressor.h" -namespace Palantir +namespace Palanthir { class FileStorage : public boost::noncopyable {
--- a/Core/HttpServer/EmbeddedResourceHttpHandler.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/EmbeddedResourceHttpHandler.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,12 +20,12 @@ #include "EmbeddedResourceHttpHandler.h" -#include "../PalantirException.h" +#include "../PalanthirException.h" #include <stdio.h> -namespace Palantir +namespace Palanthir { EmbeddedResourceHttpHandler::EmbeddedResourceHttpHandler( const std::string& baseUri, @@ -65,9 +65,9 @@ size_t size = EmbeddedResources::GetDirectoryResourceSize(resourceId_, resourcePath.c_str()); output.AnswerBufferWithContentType(buffer, size, contentType); } - catch (PalantirException& e) + catch (PalanthirException& e) { - output.SendHeader(Palantir_HttpStatus_404_NotFound); + output.SendHeader(Palanthir_HttpStatus_404_NotFound); } } }
--- a/Core/HttpServer/EmbeddedResourceHttpHandler.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/EmbeddedResourceHttpHandler.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <EmbeddedResources.h> // Autogenerated file #include <boost/shared_ptr.hpp> -namespace Palantir +namespace Palanthir { class EmbeddedResourceHttpHandler : public HttpHandler {
--- a/Core/HttpServer/FilesystemHttpHandler.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/FilesystemHttpHandler.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,12 +20,12 @@ #include "FilesystemHttpHandler.h" -#include "../PalantirException.h" +#include "../PalanthirException.h" #include <boost/filesystem.hpp> -namespace Palantir +namespace Palanthir { struct FilesystemHttpHandler::PImpl { @@ -91,7 +91,7 @@ if (!fs::exists(pimpl_->root_) || !fs::is_directory(pimpl_->root_)) { - throw PalantirException("The path does not point to a directory"); + throw PalanthirException("The path does not point to a directory"); } } @@ -136,7 +136,7 @@ } else { - output.SendHeader(Palantir_HttpStatus_404_NotFound); + output.SendHeader(Palanthir_HttpStatus_404_NotFound); } } }
--- a/Core/HttpServer/FilesystemHttpHandler.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/FilesystemHttpHandler.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <boost/shared_ptr.hpp> -namespace Palantir +namespace Palanthir { class FilesystemHttpHandler : public HttpHandler {
--- a/Core/HttpServer/HttpHandler.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/HttpHandler.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include <string.h> -namespace Palantir +namespace Palanthir { static void SplitGETNameValue(HttpHandler::Arguments& result, const char* start,
--- a/Core/HttpServer/HttpHandler.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/HttpHandler.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include "HttpOutput.h" #include "../Toolbox.h" -namespace Palantir +namespace Palanthir { class HttpHandler {
--- a/Core/HttpServer/HttpOutput.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/HttpOutput.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,11 +23,11 @@ #include <vector> #include <stdio.h> #include <boost/lexical_cast.hpp> -#include "../PalantirException.h" +#include "../PalanthirException.h" #include "../Toolbox.h" -#include "../../PalantirCppClient/HttpException.h" +#include "../../PalanthirCppClient/HttpException.h" -namespace Palantir +namespace Palanthir { void HttpOutput::SendString(const std::string& s) { @@ -82,26 +82,26 @@ void HttpOutput::SendMethodNotAllowedError(const std::string& allowed) { std::string s = - "HTTP/1.1 405 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_405_MethodNotAllowed)) + + "HTTP/1.1 405 " + std::string(HttpException::GetDescription(Palanthir_HttpStatus_405_MethodNotAllowed)) + "\r\nAllow: " + allowed + "\r\n\r\n"; Send(&s[0], s.size()); } - void HttpOutput::SendHeader(Palantir_HttpStatus status) + void HttpOutput::SendHeader(Palanthir_HttpStatus status) { - if (status == Palantir_HttpStatus_200_Ok || - status == Palantir_HttpStatus_405_MethodNotAllowed) + if (status == Palanthir_HttpStatus_200_Ok || + status == Palanthir_HttpStatus_405_MethodNotAllowed) { - throw PalantirException("Please use the dedicated methods to this HTTP status code in HttpOutput"); + throw PalanthirException("Please use the dedicated methods to this HTTP status code in HttpOutput"); } SendHeaderInternal(status); } - void HttpOutput::SendHeaderInternal(Palantir_HttpStatus status) + void HttpOutput::SendHeaderInternal(Palanthir_HttpStatus status) { std::string s = "HTTP/1.1 " + boost::lexical_cast<std::string>(status) + @@ -136,7 +136,7 @@ FILE* fp = fopen(path.c_str(), "rb"); if (!fp) { - SendHeaderInternal(Palantir_HttpStatus_500_InternalServerError); + SendHeaderInternal(Palanthir_HttpStatus_500_InternalServerError); return; } @@ -180,7 +180,7 @@ void HttpOutput::Redirect(const std::string& path) { std::string s = - "HTTP/1.1 301 " + std::string(HttpException::GetDescription(Palantir_HttpStatus_301_MovedPermanently)) + + "HTTP/1.1 301 " + std::string(HttpException::GetDescription(Palanthir_HttpStatus_301_MovedPermanently)) + "\r\nLocation: " + path + "\r\n\r\n"; Send(&s[0], s.size());
--- a/Core/HttpServer/HttpOutput.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/HttpOutput.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,12 +25,12 @@ #include "../Enumerations.h" #include "../FileStorage.h" -namespace Palantir +namespace Palanthir { class HttpOutput { private: - void SendHeaderInternal(Palantir_HttpStatus status); + void SendHeaderInternal(Palanthir_HttpStatus status); void SendOkHeader(const char* contentType, bool hasContentLength, @@ -56,7 +56,7 @@ void SendMethodNotAllowedError(const std::string& allowed); - void SendHeader(Palantir_HttpStatus status); + void SendHeader(Palanthir_HttpStatus status); // Higher-level constructs to send entire files or buffers -------------------
--- a/Core/HttpServer/MongooseServer.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/MongooseServer.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -31,17 +31,17 @@ #include <stdio.h> #include <boost/thread.hpp> -#include "../PalantirException.h" +#include "../PalanthirException.h" #include "../ChunkedBuffer.h" #include "mongoose.h" -#define PALANTIR_REALM "Palantir Secure Area" +#define PALANTHIR_REALM "Palanthir Secure Area" static const long LOCALHOST = (127ll << 24) + 1ll; -namespace Palantir +namespace Palanthir { static const char multipart[] = "multipart/form-data; boundary="; static unsigned int multipartLength = sizeof(multipart) / sizeof(char) - 1; @@ -402,7 +402,7 @@ static void SendUnauthorized(HttpOutput& output) { std::string s = "HTTP/1.1 401 Unauthorized\r\n" - "WWW-Authenticate: Basic realm=\"" PALANTIR_REALM "\"" + "WWW-Authenticate: Basic realm=\"" PALANTHIR_REALM "\"" "\r\n\r\n"; output.Send(&s[0], s.size()); } @@ -481,7 +481,7 @@ HttpHandler::Arguments::const_iterator ct = headers.find("content-type"); if (ct == headers.end()) { - output.SendHeader(Palantir_HttpStatus_400_BadRequest); + output.SendHeader(Palanthir_HttpStatus_400_BadRequest); return (void*) ""; } @@ -501,11 +501,11 @@ switch (status) { case PostDataStatus_NoLength: - output.SendHeader(Palantir_HttpStatus_411_LengthRequired); + output.SendHeader(Palanthir_HttpStatus_411_LengthRequired); return (void*) ""; case PostDataStatus_Failure: - output.SendHeader(Palantir_HttpStatus_400_BadRequest); + output.SendHeader(Palanthir_HttpStatus_400_BadRequest); return (void*) ""; case PostDataStatus_Pending: @@ -528,15 +528,15 @@ handler->Handle(output, std::string(request->request_method), uri, headers, arguments, postData); } - catch (PalantirException& e) + catch (PalanthirException& e) { std::cerr << "MongooseServer Exception [" << e.What() << "]" << std::endl; - output.SendHeader(Palantir_HttpStatus_500_InternalServerError); + output.SendHeader(Palanthir_HttpStatus_500_InternalServerError); } } else { - output.SendHeader(Palantir_HttpStatus_404_NotFound); + output.SendHeader(Palanthir_HttpStatus_404_NotFound); } // Mark as processed @@ -599,7 +599,7 @@ pimpl_->context_ = mg_start(&Callback, this, options); if (!pimpl_->context_) { - throw PalantirException("Unable to launch the Mongoose server"); + throw PalanthirException("Unable to launch the Mongoose server"); } } } @@ -654,10 +654,10 @@ { Stop(); -#if PALANTIR_SSL_ENABLED == 0 +#if PALANTHIR_SSL_ENABLED == 0 if (enabled) { - throw PalantirException("Palantir has been built without SSL support"); + throw PalanthirException("Palanthir has been built without SSL support"); } else {
--- a/Core/HttpServer/MongooseServer.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/HttpServer/MongooseServer.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -27,7 +27,7 @@ #include <stdint.h> #include <boost/shared_ptr.hpp> -namespace Palantir +namespace Palanthir { class ChunkStore;
--- a/Core/MultiThreading/BagOfRunnablesBySteps.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/MultiThreading/BagOfRunnablesBySteps.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,7 +23,7 @@ #include <stack> #include <boost/thread.hpp> -namespace Palantir +namespace Palanthir { struct BagOfRunnablesBySteps::PImpl {
--- a/Core/MultiThreading/BagOfRunnablesBySteps.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/MultiThreading/BagOfRunnablesBySteps.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <boost/noncopyable.hpp> #include <boost/shared_ptr.hpp> -namespace Palantir +namespace Palanthir { class BagOfRunnablesBySteps : public boost::noncopyable {
--- a/Core/MultiThreading/IRunnableBySteps.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/MultiThreading/IRunnableBySteps.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,7 +20,7 @@ #pragma once -namespace Palantir +namespace Palanthir { class IRunnableBySteps {
--- a/Core/PalanthirException.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/PalanthirException.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -18,11 +18,11 @@ **/ -#include "PalantirException.h" +#include "PalanthirException.h" -namespace Palantir +namespace Palanthir { - const char* PalantirException::What() const + const char* PalanthirException::What() const { if (error_ == ErrorCode_Custom) { @@ -35,7 +35,7 @@ } - const char* PalantirException::GetDescription(ErrorCode error) + const char* PalanthirException::GetDescription(ErrorCode error) { switch (error) {
--- a/Core/PalanthirException.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/PalanthirException.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,9 +23,9 @@ #include <string> #include "Enumerations.h" -namespace Palantir +namespace Palanthir { - class PalantirException + class PalanthirException { private: ErrorCode error_; @@ -34,13 +34,13 @@ public: static const char* GetDescription(ErrorCode error); - PalantirException(const std::string& custom) + PalanthirException(const std::string& custom) { error_ = ErrorCode_Custom; custom_ = custom; } - PalantirException(ErrorCode error) + PalanthirException(ErrorCode error) { error_ = error; }
--- a/Core/PngWriter.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/PngWriter.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -23,7 +23,7 @@ #include <vector> #include <stdint.h> #include <png.h> -#include "PalantirException.h" +#include "PalanthirException.h" #include "ChunkedBuffer.h" @@ -58,7 +58,7 @@ }*/ -namespace Palantir +namespace Palanthir { struct PngWriter::PImpl { @@ -82,14 +82,14 @@ (PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); //this, ErrorHandler, WarningHandler); if (!pimpl_->png_) { - throw PalantirException(ErrorCode_NotEnoughMemory); + throw PalanthirException(ErrorCode_NotEnoughMemory); } pimpl_->info_ = png_create_info_struct(pimpl_->png_); if (!pimpl_->info_) { png_destroy_write_struct(&pimpl_->png_, NULL); - throw PalantirException(ErrorCode_NotEnoughMemory); + throw PalanthirException(ErrorCode_NotEnoughMemory); } } @@ -133,7 +133,7 @@ break; default: - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } } @@ -180,7 +180,7 @@ FILE* fp = fopen(filename, "wb"); if (!fp) { - throw PalantirException(ErrorCode_CannotWriteFile); + throw PalanthirException(ErrorCode_CannotWriteFile); } png_init_io(pimpl_->png_, fp); @@ -188,7 +188,7 @@ if (setjmp(png_jmpbuf(pimpl_->png_))) { // Error during writing PNG - throw PalantirException(ErrorCode_CannotWriteFile); + throw PalanthirException(ErrorCode_CannotWriteFile); } Compress(width, height, pitch, format); @@ -223,7 +223,7 @@ if (setjmp(png_jmpbuf(pimpl_->png_))) { // Error during writing PNG - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } png_set_write_fn(pimpl_->png_, &chunks, MemoryCallback, NULL);
--- a/Core/PngWriter.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/PngWriter.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <boost/shared_ptr.hpp> #include <string> -namespace Palantir +namespace Palanthir { class PngWriter {
--- a/Core/SQLite/Connection.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/Connection.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -43,7 +43,7 @@ -namespace Palantir +namespace Palanthir { namespace SQLite { @@ -65,7 +65,7 @@ { if (!db_) { - throw PalantirException("SQLite: The database is not opened"); + throw PalanthirException("SQLite: The database is not opened"); } } @@ -73,7 +73,7 @@ { if (db_) { - throw PalantirException("SQLite: Connection is already open"); + throw PalanthirException("SQLite: Connection is already open"); } int err = sqlite3_open(path.c_str(), &db_); @@ -81,7 +81,7 @@ { Close(); db_ = NULL; - throw PalantirException("SQLite: Unable to open the database"); + throw PalanthirException("SQLite: Unable to open the database"); } // Execute PRAGMAs at this point @@ -133,7 +133,7 @@ { if (i->second->GetReferenceCount() >= 1) { - throw PalantirException("SQLite: This cached statement is already being referred to"); + throw PalanthirException("SQLite: This cached statement is already being referred to"); } return *i->second; @@ -154,7 +154,7 @@ int error = sqlite3_exec(db_, sql, NULL, NULL, NULL); if (error == SQLITE_ERROR) { - throw PalantirException("SQLite Execute error: " + std::string(sqlite3_errmsg(db_))); + throw PalanthirException("SQLite Execute error: " + std::string(sqlite3_errmsg(db_))); } else { @@ -275,7 +275,7 @@ { if (!transactionNesting_) { - throw PalantirException("Rolling back a nonexistent transaction"); + throw PalanthirException("Rolling back a nonexistent transaction"); } transactionNesting_--; @@ -294,7 +294,7 @@ { if (!transactionNesting_) { - throw PalantirException("Committing a nonexistent transaction"); + throw PalanthirException("Committing a nonexistent transaction"); } transactionNesting_--; @@ -362,7 +362,7 @@ if (err != SQLITE_OK) { delete func; - throw PalantirException("SQLite: Unable to register a function"); + throw PalanthirException("SQLite: Unable to register a function"); } return func;
--- a/Core/SQLite/Connection.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/Connection.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -48,7 +48,7 @@ #define SQLITE_FROM_HERE SQLite::StatementId(__FILE__, __LINE__) -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/FunctionContext.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/FunctionContext.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -35,7 +35,7 @@ #include <sqlite3.h> -namespace Palantir +namespace Palanthir { namespace SQLite { @@ -56,7 +56,7 @@ { if (index >= argc_) { - throw PalantirException(ErrorCode_ParameterOutOfRange); + throw PalanthirException(ErrorCode_ParameterOutOfRange); } }
--- a/Core/SQLite/FunctionContext.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/FunctionContext.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -40,7 +40,7 @@ struct sqlite3_context; struct Mem; // This corresponds to the opaque type "sqlite3_value" -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/IScalarFunction.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/IScalarFunction.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -35,7 +35,7 @@ #include "FunctionContext.h" -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/Statement.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/Statement.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -43,7 +43,7 @@ #include <sqlite3.h> #include <string.h> -namespace Palantir +namespace Palanthir { namespace SQLite { @@ -52,7 +52,7 @@ bool succeeded = (err == SQLITE_OK || err == SQLITE_ROW || err == SQLITE_DONE); if (!succeeded) { - throw PalantirException("SQLite error code " + boost::lexical_cast<std::string>(err)); + throw PalanthirException("SQLite error code " + boost::lexical_cast<std::string>(err)); } return err; @@ -63,11 +63,11 @@ if (err == SQLITE_RANGE) { // Binding to a non-existent variable is evidence of a serious error. - throw PalantirException("Bind value out of range"); + throw PalanthirException("Bind value out of range"); } else if (err != SQLITE_OK) { - throw PalantirException("SQLite error code " + boost::lexical_cast<std::string>(err)); + throw PalanthirException("SQLite error code " + boost::lexical_cast<std::string>(err)); } }
--- a/Core/SQLite/Statement.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/Statement.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -36,7 +36,7 @@ #pragma once -#include "../PalantirException.h" +#include "../PalanthirException.h" #include "StatementId.h" #include "StatementReference.h" @@ -47,7 +47,7 @@ struct sqlite3_stmt; -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/StatementId.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/StatementId.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -38,7 +38,7 @@ #include <string.h> -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/StatementId.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/StatementId.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -36,7 +36,7 @@ #pragma once -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/StatementReference.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/StatementReference.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -36,12 +36,12 @@ #include "StatementReference.h" -#include "../PalantirException.h" +#include "../PalanthirException.h" #include <cassert> #include "sqlite3.h" -namespace Palantir +namespace Palanthir { namespace SQLite { @@ -63,7 +63,7 @@ { if (database == NULL || sql == NULL) { - throw PalantirException(ErrorCode_ParameterOutOfRange); + throw PalanthirException(ErrorCode_ParameterOutOfRange); } root_ = NULL; @@ -72,7 +72,7 @@ int error = sqlite3_prepare_v2(database, sql, -1, &statement_, NULL); if (error != SQLITE_OK) { - throw PalantirException("SQLite: " + std::string(sqlite3_errmsg(database))); + throw PalanthirException("SQLite: " + std::string(sqlite3_errmsg(database))); } assert(IsRoot()); @@ -104,7 +104,7 @@ if (refCount_ != 0) { // There remain references to this object - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } else if (statement_ != NULL) { @@ -115,7 +115,7 @@ { if (root_->refCount_ == 0) { - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } else {
--- a/Core/SQLite/StatementReference.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/StatementReference.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -44,7 +44,7 @@ struct sqlite3; struct sqlite3_stmt; -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/SQLite/Transaction.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/Transaction.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -36,7 +36,7 @@ #include "Transaction.h" -namespace Palantir +namespace Palanthir { namespace SQLite { @@ -58,13 +58,13 @@ { if (isOpen_) { - throw PalantirException("SQLite: Beginning a transaction twice!"); + throw PalanthirException("SQLite: Beginning a transaction twice!"); } isOpen_ = connection_.BeginTransaction(); if (!isOpen_) { - throw PalantirException("SQLite: Unable to create a transaction"); + throw PalanthirException("SQLite: Unable to create a transaction"); } } @@ -72,7 +72,7 @@ { if (!isOpen_) { - throw PalantirException("SQLite: Attempting to roll back a nonexistent transaction. " + throw PalanthirException("SQLite: Attempting to roll back a nonexistent transaction. " "Did you remember to call Begin()?"); } @@ -85,7 +85,7 @@ { if (!isOpen_) { - throw PalantirException("SQLite: Attempting to roll back a nonexistent transaction. " + throw PalanthirException("SQLite: Attempting to roll back a nonexistent transaction. " "Did you remember to call Begin()?"); } @@ -93,7 +93,7 @@ if (!connection_.CommitTransaction()) { - throw PalantirException("SQLite: Failure when committing the transaction"); + throw PalanthirException("SQLite: Failure when committing the transaction"); } } }
--- a/Core/SQLite/Transaction.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/SQLite/Transaction.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -38,7 +38,7 @@ #include "Connection.h" -namespace Palantir +namespace Palanthir { namespace SQLite {
--- a/Core/Toolbox.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Toolbox.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,7 +20,7 @@ #include "Toolbox.h" -#include "PalantirException.h" +#include "PalanthirException.h" #include <string.h> #include <boost/filesystem.hpp> @@ -39,7 +39,7 @@ #include "../Resources/md5/md5.h" #include "../Resources/base64/base64.h" -namespace Palantir +namespace Palanthir { static bool finish; @@ -125,7 +125,7 @@ f.open(path, std::ifstream::in | std::ios::binary); if (!f.good()) { - throw PalantirException("Unable to open a file"); + throw PalanthirException("Unable to open a file"); } // http://www.cplusplus.com/reference/iostream/istream/tellg/ @@ -150,7 +150,7 @@ if (boost::filesystem::is_regular_file(path)) boost::filesystem::remove(path); else - throw PalantirException("The path is not a regular file: " + path); + throw PalanthirException("The path is not a regular file: " + path); } } @@ -166,7 +166,7 @@ if (uri.size() == 0 || uri[0] != URI_SEPARATOR) { - throw PalantirException(ErrorCode_UriSyntax); + throw PalanthirException(ErrorCode_UriSyntax); } // Count the number of slashes in the URI to make an assumption @@ -301,7 +301,7 @@ } catch (boost::filesystem::filesystem_error) { - throw PalantirException(ErrorCode_InexistentFile); + throw PalanthirException(ErrorCode_InexistentFile); } }
--- a/Core/Toolbox.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Toolbox.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <vector> #include <string> -namespace Palantir +namespace Palanthir { typedef std::vector<std::string> UriComponents;
--- a/Core/Uuid.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Uuid.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -31,7 +31,7 @@ #endif } -namespace Palantir +namespace Palanthir { namespace Toolbox {
--- a/Core/Uuid.h Wed Sep 05 15:38:08 2012 +0200 +++ b/Core/Uuid.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -31,7 +31,7 @@ * http://stackoverflow.com/questions/246930/is-there-any-difference-between-a-guid-and-a-uuid **/ -namespace Palantir +namespace Palanthir { namespace Toolbox {
--- a/PalanthirCppClient/HttpClient.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirCppClient/HttpClient.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -31,7 +31,7 @@ #include <curl/curl.h> -namespace Palantir +namespace Palanthir { struct HttpClient::PImpl { @@ -88,13 +88,13 @@ CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_HEADER, 0)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_FOLLOWLOCATION, 1)); -#if PALANTIR_SSL_ENABLED == 1 +#if PALANTHIR_SSL_ENABLED == 1 CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_SSL_VERIFYPEER, 0)); #endif url_ = ""; - method_ = Palantir_HttpMethod_Get; - lastStatus_ = Palantir_HttpStatus_200_Ok; + method_ = Palanthir_HttpMethod_Get; + lastStatus_ = Palanthir_HttpStatus_200_Ok; isVerbose_ = false; } @@ -130,11 +130,11 @@ switch (method_) { - case Palantir_HttpMethod_Get: + case Palanthir_HttpMethod_Get: CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_HTTPGET, 1L)); break; - case Palantir_HttpMethod_Post: + case Palanthir_HttpMethod_Post: CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_POST, 1L)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_HTTPHEADER, pimpl_->postHeaders_)); @@ -151,12 +151,12 @@ break; - case Palantir_HttpMethod_Delete: + case Palanthir_HttpMethod_Delete: CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_NOBODY, 1L)); CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_CUSTOMREQUEST, "DELETE")); break; - case Palantir_HttpMethod_Put: + case Palanthir_HttpMethod_Put: CheckCode(curl_easy_setopt(pimpl_->curl_, CURLOPT_PUT, 1L)); break; @@ -173,11 +173,11 @@ if (status == 0) { // This corresponds to a call to an inexistent host - lastStatus_ = Palantir_HttpStatus_500_InternalServerError; + lastStatus_ = Palanthir_HttpStatus_500_InternalServerError; } else { - lastStatus_ = static_cast<Palantir_HttpStatus>(status); + lastStatus_ = static_cast<Palanthir_HttpStatus>(status); } return (status >= 200 && status < 300);
--- a/PalanthirCppClient/HttpClient.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirCppClient/HttpClient.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -34,7 +34,7 @@ #include <boost/shared_ptr.hpp> #include <json/json.h> -namespace Palantir +namespace Palanthir { class HttpClient { @@ -43,8 +43,8 @@ boost::shared_ptr<PImpl> pimpl_; std::string url_; - Palantir_HttpMethod method_; - Palantir_HttpStatus lastStatus_; + Palanthir_HttpMethod method_; + Palanthir_HttpStatus lastStatus_; std::string postData_; bool isVerbose_; @@ -68,12 +68,12 @@ return url_; } - void SetMethod(Palantir_HttpMethod method) + void SetMethod(Palanthir_HttpMethod method) { method_ = method; } - Palantir_HttpMethod GetMethod() const + Palanthir_HttpMethod GetMethod() const { return method_; } @@ -99,7 +99,7 @@ bool Apply(Json::Value& answer); - Palantir_HttpStatus GetLastStatus() const + Palanthir_HttpStatus GetLastStatus() const { return lastStatus_; }
--- a/PalanthirCppClient/HttpEnumerations.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirCppClient/HttpEnumerations.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -29,85 +29,85 @@ /** - * This file contains the enumerations for the access to the Palantir + * This file contains the enumerations for the access to the Palanthir * REST API in C and C++. Namespaces are not used, in order to enable * the access in C. **/ // Most common, non-joke and non-experimental HTTP status codes // http://en.wikipedia.org/wiki/List_of_HTTP_status_codes -enum Palantir_HttpStatus +enum Palanthir_HttpStatus { - Palantir_HttpStatus_None = -1, + Palanthir_HttpStatus_None = -1, // 1xx Informational - Palantir_HttpStatus_100_Continue = 100, - Palantir_HttpStatus_101_SwitchingProtocols = 101, - Palantir_HttpStatus_102_Processing = 102, + Palanthir_HttpStatus_100_Continue = 100, + Palanthir_HttpStatus_101_SwitchingProtocols = 101, + Palanthir_HttpStatus_102_Processing = 102, // 2xx Success - Palantir_HttpStatus_200_Ok = 200, - Palantir_HttpStatus_201_Created = 201, - Palantir_HttpStatus_202_Accepted = 202, - Palantir_HttpStatus_203_NonAuthoritativeInformation = 203, - Palantir_HttpStatus_204_NoContent = 204, - Palantir_HttpStatus_205_ResetContent = 205, - Palantir_HttpStatus_206_PartialContent = 206, - Palantir_HttpStatus_207_MultiStatus = 207, - Palantir_HttpStatus_208_AlreadyReported = 208, - Palantir_HttpStatus_226_IMUsed = 226, + Palanthir_HttpStatus_200_Ok = 200, + Palanthir_HttpStatus_201_Created = 201, + Palanthir_HttpStatus_202_Accepted = 202, + Palanthir_HttpStatus_203_NonAuthoritativeInformation = 203, + Palanthir_HttpStatus_204_NoContent = 204, + Palanthir_HttpStatus_205_ResetContent = 205, + Palanthir_HttpStatus_206_PartialContent = 206, + Palanthir_HttpStatus_207_MultiStatus = 207, + Palanthir_HttpStatus_208_AlreadyReported = 208, + Palanthir_HttpStatus_226_IMUsed = 226, // 3xx Redirection - Palantir_HttpStatus_300_MultipleChoices = 300, - Palantir_HttpStatus_301_MovedPermanently = 301, - Palantir_HttpStatus_302_Found = 302, - Palantir_HttpStatus_303_SeeOther = 303, - Palantir_HttpStatus_304_NotModified = 304, - Palantir_HttpStatus_305_UseProxy = 305, - Palantir_HttpStatus_307_TemporaryRedirect = 307, + Palanthir_HttpStatus_300_MultipleChoices = 300, + Palanthir_HttpStatus_301_MovedPermanently = 301, + Palanthir_HttpStatus_302_Found = 302, + Palanthir_HttpStatus_303_SeeOther = 303, + Palanthir_HttpStatus_304_NotModified = 304, + Palanthir_HttpStatus_305_UseProxy = 305, + Palanthir_HttpStatus_307_TemporaryRedirect = 307, // 4xx Client Error - Palantir_HttpStatus_400_BadRequest = 400, - Palantir_HttpStatus_401_Unauthorized = 401, - Palantir_HttpStatus_402_PaymentRequired = 402, - Palantir_HttpStatus_403_Forbidden = 403, - Palantir_HttpStatus_404_NotFound = 404, - Palantir_HttpStatus_405_MethodNotAllowed = 405, - Palantir_HttpStatus_406_NotAcceptable = 406, - Palantir_HttpStatus_407_ProxyAuthenticationRequired = 407, - Palantir_HttpStatus_408_RequestTimeout = 408, - Palantir_HttpStatus_409_Conflict = 409, - Palantir_HttpStatus_410_Gone = 410, - Palantir_HttpStatus_411_LengthRequired = 411, - Palantir_HttpStatus_412_PreconditionFailed = 412, - Palantir_HttpStatus_413_RequestEntityTooLarge = 413, - Palantir_HttpStatus_414_RequestUriTooLong = 414, - Palantir_HttpStatus_415_UnsupportedMediaType = 415, - Palantir_HttpStatus_416_RequestedRangeNotSatisfiable = 416, - Palantir_HttpStatus_417_ExpectationFailed = 417, - Palantir_HttpStatus_422_UnprocessableEntity = 422, - Palantir_HttpStatus_423_Locked = 423, - Palantir_HttpStatus_424_FailedDependency = 424, - Palantir_HttpStatus_426_UpgradeRequired = 426, + Palanthir_HttpStatus_400_BadRequest = 400, + Palanthir_HttpStatus_401_Unauthorized = 401, + Palanthir_HttpStatus_402_PaymentRequired = 402, + Palanthir_HttpStatus_403_Forbidden = 403, + Palanthir_HttpStatus_404_NotFound = 404, + Palanthir_HttpStatus_405_MethodNotAllowed = 405, + Palanthir_HttpStatus_406_NotAcceptable = 406, + Palanthir_HttpStatus_407_ProxyAuthenticationRequired = 407, + Palanthir_HttpStatus_408_RequestTimeout = 408, + Palanthir_HttpStatus_409_Conflict = 409, + Palanthir_HttpStatus_410_Gone = 410, + Palanthir_HttpStatus_411_LengthRequired = 411, + Palanthir_HttpStatus_412_PreconditionFailed = 412, + Palanthir_HttpStatus_413_RequestEntityTooLarge = 413, + Palanthir_HttpStatus_414_RequestUriTooLong = 414, + Palanthir_HttpStatus_415_UnsupportedMediaType = 415, + Palanthir_HttpStatus_416_RequestedRangeNotSatisfiable = 416, + Palanthir_HttpStatus_417_ExpectationFailed = 417, + Palanthir_HttpStatus_422_UnprocessableEntity = 422, + Palanthir_HttpStatus_423_Locked = 423, + Palanthir_HttpStatus_424_FailedDependency = 424, + Palanthir_HttpStatus_426_UpgradeRequired = 426, // 5xx Server Error - Palantir_HttpStatus_500_InternalServerError = 500, - Palantir_HttpStatus_501_NotImplemented = 501, - Palantir_HttpStatus_502_BadGateway = 502, - Palantir_HttpStatus_503_ServiceUnavailable = 503, - Palantir_HttpStatus_504_GatewayTimeout = 504, - Palantir_HttpStatus_505_HttpVersionNotSupported = 505, - Palantir_HttpStatus_506_VariantAlsoNegotiates = 506, - Palantir_HttpStatus_507_InsufficientStorage = 507, - Palantir_HttpStatus_509_BandwidthLimitExceeded = 509, - Palantir_HttpStatus_510_NotExtended = 510 + Palanthir_HttpStatus_500_InternalServerError = 500, + Palanthir_HttpStatus_501_NotImplemented = 501, + Palanthir_HttpStatus_502_BadGateway = 502, + Palanthir_HttpStatus_503_ServiceUnavailable = 503, + Palanthir_HttpStatus_504_GatewayTimeout = 504, + Palanthir_HttpStatus_505_HttpVersionNotSupported = 505, + Palanthir_HttpStatus_506_VariantAlsoNegotiates = 506, + Palanthir_HttpStatus_507_InsufficientStorage = 507, + Palanthir_HttpStatus_509_BandwidthLimitExceeded = 509, + Palanthir_HttpStatus_510_NotExtended = 510 }; -enum Palantir_HttpMethod +enum Palanthir_HttpMethod { - Palantir_HttpMethod_Get = 0, - Palantir_HttpMethod_Post = 1, - Palantir_HttpMethod_Delete = 2, - Palantir_HttpMethod_Put = 3 + Palanthir_HttpMethod_Get = 0, + Palanthir_HttpMethod_Post = 1, + Palanthir_HttpMethod_Delete = 2, + Palanthir_HttpMethod_Put = 3 };
--- a/PalanthirCppClient/HttpException.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirCppClient/HttpException.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -27,11 +27,11 @@ #include "HttpException.h" -namespace Palantir +namespace Palanthir { const char* HttpException::What() const { - if (status_ == Palantir_HttpStatus_None) + if (status_ == Palanthir_HttpStatus_None) { return custom_.c_str(); } @@ -41,164 +41,164 @@ } } - const char* HttpException::GetDescription(Palantir_HttpStatus status) + const char* HttpException::GetDescription(Palanthir_HttpStatus status) { switch (status) { - case Palantir_HttpStatus_100_Continue: + case Palanthir_HttpStatus_100_Continue: return "Continue"; - case Palantir_HttpStatus_101_SwitchingProtocols: + case Palanthir_HttpStatus_101_SwitchingProtocols: return "Switching Protocols"; - case Palantir_HttpStatus_102_Processing: + case Palanthir_HttpStatus_102_Processing: return "Processing"; - case Palantir_HttpStatus_200_Ok: + case Palanthir_HttpStatus_200_Ok: return "OK"; - case Palantir_HttpStatus_201_Created: + case Palanthir_HttpStatus_201_Created: return "Created"; - case Palantir_HttpStatus_202_Accepted: + case Palanthir_HttpStatus_202_Accepted: return "Accepted"; - case Palantir_HttpStatus_203_NonAuthoritativeInformation: + case Palanthir_HttpStatus_203_NonAuthoritativeInformation: return "Non-Authoritative Information"; - case Palantir_HttpStatus_204_NoContent: + case Palanthir_HttpStatus_204_NoContent: return "No Content"; - case Palantir_HttpStatus_205_ResetContent: + case Palanthir_HttpStatus_205_ResetContent: return "Reset Content"; - case Palantir_HttpStatus_206_PartialContent: + case Palanthir_HttpStatus_206_PartialContent: return "Partial Content"; - case Palantir_HttpStatus_207_MultiStatus: + case Palanthir_HttpStatus_207_MultiStatus: return "Multi-Status"; - case Palantir_HttpStatus_208_AlreadyReported: + case Palanthir_HttpStatus_208_AlreadyReported: return "Already Reported"; - case Palantir_HttpStatus_226_IMUsed: + case Palanthir_HttpStatus_226_IMUsed: return "IM Used"; - case Palantir_HttpStatus_300_MultipleChoices: + case Palanthir_HttpStatus_300_MultipleChoices: return "Multiple Choices"; - case Palantir_HttpStatus_301_MovedPermanently: + case Palanthir_HttpStatus_301_MovedPermanently: return "Moved Permanently"; - case Palantir_HttpStatus_302_Found: + case Palanthir_HttpStatus_302_Found: return "Found"; - case Palantir_HttpStatus_303_SeeOther: + case Palanthir_HttpStatus_303_SeeOther: return "See Other"; - case Palantir_HttpStatus_304_NotModified: + case Palanthir_HttpStatus_304_NotModified: return "Not Modified"; - case Palantir_HttpStatus_305_UseProxy: + case Palanthir_HttpStatus_305_UseProxy: return "Use Proxy"; - case Palantir_HttpStatus_307_TemporaryRedirect: + case Palanthir_HttpStatus_307_TemporaryRedirect: return "Temporary Redirect"; - case Palantir_HttpStatus_400_BadRequest: + case Palanthir_HttpStatus_400_BadRequest: return "Bad Request"; - case Palantir_HttpStatus_401_Unauthorized: + case Palanthir_HttpStatus_401_Unauthorized: return "Unauthorized"; - case Palantir_HttpStatus_402_PaymentRequired: + case Palanthir_HttpStatus_402_PaymentRequired: return "Payment Required"; - case Palantir_HttpStatus_403_Forbidden: + case Palanthir_HttpStatus_403_Forbidden: return "Forbidden"; - case Palantir_HttpStatus_404_NotFound: + case Palanthir_HttpStatus_404_NotFound: return "Not Found"; - case Palantir_HttpStatus_405_MethodNotAllowed: + case Palanthir_HttpStatus_405_MethodNotAllowed: return "Method Not Allowed"; - case Palantir_HttpStatus_406_NotAcceptable: + case Palanthir_HttpStatus_406_NotAcceptable: return "Not Acceptable"; - case Palantir_HttpStatus_407_ProxyAuthenticationRequired: + case Palanthir_HttpStatus_407_ProxyAuthenticationRequired: return "Proxy Authentication Required"; - case Palantir_HttpStatus_408_RequestTimeout: + case Palanthir_HttpStatus_408_RequestTimeout: return "Request Timeout"; - case Palantir_HttpStatus_409_Conflict: + case Palanthir_HttpStatus_409_Conflict: return "Conflict"; - case Palantir_HttpStatus_410_Gone: + case Palanthir_HttpStatus_410_Gone: return "Gone"; - case Palantir_HttpStatus_411_LengthRequired: + case Palanthir_HttpStatus_411_LengthRequired: return "Length Required"; - case Palantir_HttpStatus_412_PreconditionFailed: + case Palanthir_HttpStatus_412_PreconditionFailed: return "Precondition Failed"; - case Palantir_HttpStatus_413_RequestEntityTooLarge: + case Palanthir_HttpStatus_413_RequestEntityTooLarge: return "Request Entity Too Large"; - case Palantir_HttpStatus_414_RequestUriTooLong: + case Palanthir_HttpStatus_414_RequestUriTooLong: return "Request-URI Too Long"; - case Palantir_HttpStatus_415_UnsupportedMediaType: + case Palanthir_HttpStatus_415_UnsupportedMediaType: return "Unsupported Media Type"; - case Palantir_HttpStatus_416_RequestedRangeNotSatisfiable: + case Palanthir_HttpStatus_416_RequestedRangeNotSatisfiable: return "Requested Range Not Satisfiable"; - case Palantir_HttpStatus_417_ExpectationFailed: + case Palanthir_HttpStatus_417_ExpectationFailed: return "Expectation Failed"; - case Palantir_HttpStatus_422_UnprocessableEntity: + case Palanthir_HttpStatus_422_UnprocessableEntity: return "Unprocessable Entity"; - case Palantir_HttpStatus_423_Locked: + case Palanthir_HttpStatus_423_Locked: return "Locked"; - case Palantir_HttpStatus_424_FailedDependency: + case Palanthir_HttpStatus_424_FailedDependency: return "Failed Dependency"; - case Palantir_HttpStatus_426_UpgradeRequired: + case Palanthir_HttpStatus_426_UpgradeRequired: return "Upgrade Required"; - case Palantir_HttpStatus_500_InternalServerError: + case Palanthir_HttpStatus_500_InternalServerError: return "Internal Server Error"; - case Palantir_HttpStatus_501_NotImplemented: + case Palanthir_HttpStatus_501_NotImplemented: return "Not Implemented"; - case Palantir_HttpStatus_502_BadGateway: + case Palanthir_HttpStatus_502_BadGateway: return "Bad Gateway"; - case Palantir_HttpStatus_503_ServiceUnavailable: + case Palanthir_HttpStatus_503_ServiceUnavailable: return "Service Unavailable"; - case Palantir_HttpStatus_504_GatewayTimeout: + case Palanthir_HttpStatus_504_GatewayTimeout: return "Gateway Timeout"; - case Palantir_HttpStatus_505_HttpVersionNotSupported: + case Palanthir_HttpStatus_505_HttpVersionNotSupported: return "HTTP Version Not Supported"; - case Palantir_HttpStatus_506_VariantAlsoNegotiates: + case Palanthir_HttpStatus_506_VariantAlsoNegotiates: return "Variant Also Negotiates"; - case Palantir_HttpStatus_507_InsufficientStorage: + case Palanthir_HttpStatus_507_InsufficientStorage: return "Insufficient Storage"; - case Palantir_HttpStatus_509_BandwidthLimitExceeded: + case Palanthir_HttpStatus_509_BandwidthLimitExceeded: return "Bandwidth Limit Exceeded"; - case Palantir_HttpStatus_510_NotExtended: + case Palanthir_HttpStatus_510_NotExtended: return "Not Extended"; default:
--- a/PalanthirCppClient/HttpException.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirCppClient/HttpException.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -31,29 +31,29 @@ #include <string> -namespace Palantir +namespace Palanthir { class HttpException { private: - Palantir_HttpStatus status_; + Palanthir_HttpStatus status_; std::string custom_; public: - static const char* GetDescription(Palantir_HttpStatus status); + static const char* GetDescription(Palanthir_HttpStatus status); HttpException(const std::string& custom) { - status_ = Palantir_HttpStatus_None; + status_ = Palanthir_HttpStatus_None; custom_ = custom; } - HttpException(Palantir_HttpStatus status) + HttpException(Palanthir_HttpStatus status) { status_ = status; } - Palantir_HttpStatus GetHttpStatus() const + Palanthir_HttpStatus GetHttpStatus() const { return status_; }
--- a/PalanthirCppClient/main.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirCppClient/main.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -32,7 +32,7 @@ int main() { // Prepare a simple call to a Web service - Palantir::HttpClient c; + Palanthir::HttpClient c; c.SetUrl("http://nominatim.openstreetmap.org/search?format=json&q=chu+liege+belgium"); // Do the request and store the result in a JSON structure
--- a/PalanthirExplorer/explorer.html Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirExplorer/explorer.html Wed Sep 05 15:50:12 2012 +0200 @@ -4,7 +4,7 @@ <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <title>Palantir Explorer</title> + <title>Palanthir Explorer</title> <link rel="stylesheet" href="libs/jquery.mobile-1.1.0.min.css" /> <link rel="stylesheet" href="libs/jqtree.css" />
--- a/PalanthirServer/DicomIntegerPixelAccessor.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomIntegerPixelAccessor.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,12 +24,12 @@ #define NOMINMAX #endif -#include "../Core/PalantirException.h" +#include "../Core/PalanthirException.h" #include "FromDcmtkBridge.h" #include <boost/lexical_cast.hpp> #include <limits> -namespace Palantir +namespace Palanthir { DicomIntegerPixelAccessor::DicomIntegerPixelAccessor(const DicomMap& values, const void* pixelData, @@ -54,30 +54,30 @@ } catch (boost::bad_lexical_cast) { - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } if (bitsAllocated != 8 && bitsAllocated != 16 && bitsAllocated != 24 && bitsAllocated != 32) { - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } if (bitsAllocated > 32 || bitsStored >= 32) { // Not available, as the accessor internally uses int32_t values - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } if (samplesPerPixel_ != 1) { - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } if (width_ * height_ * bitsAllocated / 8 != size) { - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } /*printf("%d %d %d %d %d %d %d\n", width_, height_, samplesPerPixel_, bitsAllocated, @@ -145,7 +145,7 @@ if (v & signMask_) { // Signed value: Not implemented yet - //throw PalantirException(ErrorCode_NotImplemented); + //throw PalanthirException(ErrorCode_NotImplemented); v = 0; }
--- a/PalanthirServer/DicomIntegerPixelAccessor.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomIntegerPixelAccessor.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <stdint.h> -namespace Palantir +namespace Palanthir { class DicomIntegerPixelAccessor {
--- a/PalanthirServer/DicomProtocol/DicomFindAnswers.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/DicomFindAnswers.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "../FromDcmtkBridge.h" -namespace Palantir +namespace Palanthir { void DicomFindAnswers::Clear() {
--- a/PalanthirServer/DicomProtocol/DicomFindAnswers.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/DicomFindAnswers.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <vector> #include <json/json.h> -namespace Palantir +namespace Palanthir { class DicomFindAnswers {
--- a/PalanthirServer/DicomProtocol/DicomServer.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/DicomServer.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,7 +20,7 @@ #include "DicomServer.h" -#include "../../Core/PalantirException.h" +#include "../../Core/PalanthirException.h" #include "../../Core/Toolbox.h" #include "../Internals/CommandDispatcher.h" @@ -28,7 +28,7 @@ #include <dcmtk/dcmdata/dcdict.h> -namespace Palantir +namespace Palanthir { struct DicomServer::PImpl { @@ -64,7 +64,7 @@ { OFString temp_str; OFLOG_ERROR(Internals::Logger, "cannot create network: " << DimseCondition::dump(temp_str, cond)); - throw PalantirException("Cannot create network"); + throw PalanthirException("Cannot create network"); } OFLOG_WARN(Internals::Logger, "DICOM server started"); @@ -170,14 +170,14 @@ { if (aet.size() == 0) { - throw PalantirException("Too short AET"); + throw PalanthirException("Too short AET"); } for (size_t i = 0; i < aet.size(); i++) { if (!isalnum(aet[i]) && aet[i] != '-') { - throw PalantirException("Only alphanumeric characters are allowed in AET"); + throw PalanthirException("Only alphanumeric characters are allowed in AET"); } } @@ -209,7 +209,7 @@ } else { - throw PalantirException("No C-FIND request handler factory"); + throw PalanthirException("No C-FIND request handler factory"); } } @@ -232,7 +232,7 @@ } else { - throw PalantirException("No C-MOVE request handler factory"); + throw PalanthirException("No C-MOVE request handler factory"); } } @@ -255,7 +255,7 @@ } else { - throw PalantirException("No C-STORE request handler factory"); + throw PalanthirException("No C-STORE request handler factory"); } } @@ -278,7 +278,7 @@ } else { - throw PalantirException("No application entity filter"); + throw PalanthirException("No application entity filter"); } }
--- a/PalanthirServer/DicomProtocol/DicomServer.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/DicomServer.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -29,7 +29,7 @@ #include <boost/shared_ptr.hpp> #include <boost/noncopyable.hpp> -namespace Palantir +namespace Palanthir { class DicomServer : public boost::noncopyable {
--- a/PalanthirServer/DicomProtocol/DicomUserConnection.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/DicomUserConnection.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,7 +20,7 @@ #include "DicomUserConnection.h" -#include "../../Core/PalantirException.h" +#include "../../Core/PalanthirException.h" #include "../ToDcmtkBridge.h" #include "../FromDcmtkBridge.h" @@ -46,7 +46,7 @@ #endif -namespace Palantir +namespace Palanthir { struct DicomUserConnection::PImpl { @@ -70,7 +70,7 @@ { if (cond.bad()) { - throw PalantirException("DicomUserConnection: " + std::string(cond.text())); + throw PalanthirException("DicomUserConnection: " + std::string(cond.text())); } } @@ -78,7 +78,7 @@ { if (!IsOpen()) { - throw PalantirException("DicomUserConnection: First open the connection"); + throw PalanthirException("DicomUserConnection: First open the connection"); } } @@ -170,7 +170,7 @@ DIC_UI sopInstance; if (!DU_findSOPClassAndInstanceInDataSet(dcmff.getDataset(), sopClass, sopInstance)) { - throw PalantirException("DicomUserConnection: Unable to find the SOP class and instance"); + throw PalanthirException("DicomUserConnection: Unable to find the SOP class and instance"); } // Figure out which of the accepted presentation contexts should be used @@ -180,7 +180,7 @@ const char *modalityName = dcmSOPClassUIDToModality(sopClass); if (!modalityName) modalityName = dcmFindNameOfUID(sopClass); if (!modalityName) modalityName = "unknown SOP class"; - throw PalantirException("DicomUserConnection: No presentation context for modality " + + throw PalanthirException("DicomUserConnection: No presentation context for modality " + std::string(modalityName)); } @@ -306,14 +306,14 @@ break; default: - throw PalantirException(ErrorCode_ParameterOutOfRange); + throw PalanthirException(ErrorCode_ParameterOutOfRange); } // Figure out which of the accepted presentation contexts should be used int presID = ASC_findAcceptedPresentationContextID(pimpl_->assoc_, sopClass); if (presID == 0) { - throw PalantirException("DicomUserConnection: The C-FIND command is not supported by the distant AET"); + throw PalanthirException("DicomUserConnection: The C-FIND command is not supported by the distant AET"); } T_DIMSE_C_FindRQ request; @@ -403,7 +403,7 @@ int presID = ASC_findAcceptedPresentationContextID(pimpl_->assoc_, sopClass); if (presID == 0) { - throw PalantirException("DicomUserConnection: The C-MOVE command is not supported by the distant AET"); + throw PalanthirException("DicomUserConnection: The C-MOVE command is not supported by the distant AET"); } T_DIMSE_C_MoveRQ request; @@ -471,7 +471,7 @@ { if (host.size() > HOST_NAME_MAX - 10) { - throw PalantirException("Distant host name is too long"); + throw PalanthirException("Distant host name is too long"); } Close(); @@ -519,7 +519,7 @@ if (ASC_countAcceptedPresentationContexts(pimpl_->params_) == 0) { - throw PalantirException("DicomUserConnection: No Acceptable Presentation Contexts"); + throw PalanthirException("DicomUserConnection: No Acceptable Presentation Contexts"); } }
--- a/PalanthirServer/DicomProtocol/DicomUserConnection.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/DicomUserConnection.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include <boost/shared_ptr.hpp> #include <boost/noncopyable.hpp> -namespace Palantir +namespace Palanthir { class DicomUserConnection : public boost::noncopyable {
--- a/PalanthirServer/DicomProtocol/IApplicationEntityFilter.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IApplicationEntityFilter.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include <string> -namespace Palantir +namespace Palanthir { class IApplicationEntityFilter {
--- a/PalanthirServer/DicomProtocol/IFindRequestHandler.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IFindRequestHandler.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include <string> -namespace Palantir +namespace Palanthir { class IFindRequestHandler {
--- a/PalanthirServer/DicomProtocol/IFindRequestHandlerFactory.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IFindRequestHandlerFactory.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "IFindRequestHandler.h" -namespace Palantir +namespace Palanthir { class IFindRequestHandlerFactory {
--- a/PalanthirServer/DicomProtocol/IMoveRequestHandler.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IMoveRequestHandler.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include <string> -namespace Palantir +namespace Palanthir { class IMoveRequestIterator {
--- a/PalanthirServer/DicomProtocol/IMoveRequestHandlerFactory.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IMoveRequestHandlerFactory.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "IMoveRequestHandler.h" -namespace Palantir +namespace Palanthir { class IMoveRequestHandlerFactory {
--- a/PalanthirServer/DicomProtocol/IStoreRequestHandler.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IStoreRequestHandler.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include <string> #include <json/json.h> -namespace Palantir +namespace Palanthir { class IStoreRequestHandler {
--- a/PalanthirServer/DicomProtocol/IStoreRequestHandlerFactory.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/DicomProtocol/IStoreRequestHandlerFactory.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "IStoreRequestHandler.h" -namespace Palantir +namespace Palanthir { class IStoreRequestHandlerFactory {
--- a/PalanthirServer/FromDcmtkBridge.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/FromDcmtkBridge.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "ToDcmtkBridge.h" #include "DicomIntegerPixelAccessor.h" -#include "../Core/PalantirException.h" +#include "../Core/PalanthirException.h" #include "../Core/PngWriter.h" #include "../Core/DicomFormat/DicomString.h" #include "../Core/DicomFormat/DicomNullValue.h" @@ -45,7 +45,7 @@ #include <boost/math/special_functions/round.hpp> -namespace Palantir +namespace Palanthir { void FromDcmtkBridge::Convert(DicomMap& target, DcmDataset& dataset) { @@ -73,7 +73,7 @@ { if (!element.isLeaf()) { - throw PalantirException("Only applicable to leaf elements"); + throw PalanthirException("Only applicable to leaf elements"); } if (element.isaString()) @@ -370,7 +370,7 @@ DcmFileFormat dicom; if (!dicom.loadFile(path.c_str()).good()) { - throw PalantirException(ErrorCode_BadFileFormat); + throw PalanthirException(ErrorCode_BadFileFormat); } else { @@ -471,7 +471,7 @@ break; default: - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } if (accessor.get() == NULL || @@ -498,7 +498,7 @@ break; default: - throw PalantirException(ErrorCode_NotImplemented); + throw PalanthirException(ErrorCode_NotImplemented); } } } @@ -522,7 +522,7 @@ } else { - throw PalantirException(ErrorCode_BadFileFormat); + throw PalanthirException(ErrorCode_BadFileFormat); } } @@ -553,7 +553,7 @@ if (entry == NULL) { dcmDataDict.unlock(); - throw PalantirException("Unknown DICOM tag"); + throw PalanthirException("Unknown DICOM tag"); } else { @@ -582,7 +582,7 @@ { if (result.type() != Json::objectValue) { - throw PalantirException(ErrorCode_BadParameterType); + throw PalanthirException(ErrorCode_BadParameterType); } result.clear();
--- a/PalanthirServer/FromDcmtkBridge.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/FromDcmtkBridge.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <dcmtk/dcmdata/dcdatset.h> #include <json/json.h> -namespace Palantir +namespace Palanthir { enum ImageExtractionMode {
--- a/PalanthirServer/Internals/CommandDispatcher.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/CommandDispatcher.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -30,7 +30,7 @@ static OFBool opt_rejectWithoutImplementationUID = OFFalse; -namespace Palantir +namespace Palanthir { namespace Internals {
--- a/PalanthirServer/Internals/CommandDispatcher.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/CommandDispatcher.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include <dcmtk/dcmnet/assoc.h> #include <dcmtk/dcmnet/dimse.h> -namespace Palantir +namespace Palanthir { namespace Internals {
--- a/PalanthirServer/Internals/FindScp.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/FindScp.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "../FromDcmtkBridge.h" #include "../ToDcmtkBridge.h" -#include "../../Core/PalantirException.h" +#include "../../Core/PalanthirException.h" #include <dcmtk/dcmdata/dcfilefo.h> #include <dcmtk/dcmdata/dcmetinf.h> @@ -31,7 +31,7 @@ #include <dcmtk/dcmnet/diutil.h> -namespace Palantir +namespace Palanthir { namespace Internals { @@ -74,7 +74,7 @@ { data.handler_->Handle(data.input_, data.answers_); } - catch (PalantirException& e) + catch (PalanthirException& e) { // Internal error! OFLOG_ERROR(Internals::Logger, "IFindRequestHandler Failed: " << e.What());
--- a/PalanthirServer/Internals/FindScp.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/FindScp.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <dcmtk/dcmnet/assoc.h> #include <dcmtk/dcmnet/dimse.h> -namespace Palantir +namespace Palanthir { namespace Internals {
--- a/PalanthirServer/Internals/MoveScp.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/MoveScp.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include "../FromDcmtkBridge.h" #include "../ToDcmtkBridge.h" -#include "../../Core/PalantirException.h" +#include "../../Core/PalanthirException.h" #include <dcmtk/dcmdata/dcfilefo.h> #include <dcmtk/dcmdata/dcmetinf.h> @@ -33,7 +33,7 @@ #include <dcmtk/dcmnet/diutil.h> -namespace Palantir +namespace Palanthir { namespace Internals { @@ -84,7 +84,7 @@ data.failureCount_ = 0; data.warningCount_ = 0; } - catch (PalantirException& e) + catch (PalanthirException& e) { // Internal error! OFLOG_ERROR(Internals::Logger, "IMoveRequestHandler Failed: " << e.What()); @@ -113,7 +113,7 @@ { status = data.iterator_->DoNext(); } - catch (PalantirException& e) + catch (PalanthirException& e) { // Internal error! OFLOG_ERROR(Internals::Logger, "IMoveRequestHandler Failed: " << e.What());
--- a/PalanthirServer/Internals/MoveScp.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/MoveScp.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <dcmtk/dcmnet/assoc.h> #include <dcmtk/dcmnet/dimse.h> -namespace Palantir +namespace Palanthir { namespace Internals {
--- a/PalanthirServer/Internals/StoreScp.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/StoreScp.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -22,7 +22,7 @@ #include "../FromDcmtkBridge.h" #include "../ToDcmtkBridge.h" -#include "../../Core/PalantirException.h" +#include "../../Core/PalanthirException.h" #include <dcmtk/dcmdata/dcfilefo.h> #include <dcmtk/dcmdata/dcmetinf.h> @@ -31,7 +31,7 @@ #include <dcmtk/dcmnet/diutil.h> -namespace Palantir +namespace Palanthir { namespace Internals { @@ -188,7 +188,7 @@ { cbdata->handler->Handle(buffer, summary, dicomJson, cbdata->distantAET); } - catch (PalantirException& e) + catch (PalanthirException& e) { rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; OFLOG_ERROR(Internals::Logger, "Exception while storing DICOM: " << e.What());
--- a/PalanthirServer/Internals/StoreScp.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/Internals/StoreScp.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <dcmtk/dcmnet/assoc.h> #include <dcmtk/dcmnet/dimse.h> -namespace Palantir +namespace Palanthir { namespace Internals {
--- a/PalanthirServer/PalanthirInitialization.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/PalanthirInitialization.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -18,9 +18,9 @@ **/ -#include "PalantirInitialization.h" +#include "PalanthirInitialization.h" -#include "../Core/PalantirException.h" +#include "../Core/PalanthirException.h" #include "../Core/Toolbox.h" #include <boost/lexical_cast.hpp> @@ -28,7 +28,7 @@ #include <curl/curl.h> #include <boost/thread.hpp> -namespace Palantir +namespace Palanthir { static const char* CONFIGURATION_FILE = "Configuration.json"; @@ -50,8 +50,8 @@ { try { -#if PALANTIR_STANDALONE == 0 - boost::filesystem::path p = PALANTIR_PATH; +#if PALANTHIR_STANDALONE == 0 + boost::filesystem::path p = PALANTHIR_PATH; p /= "Resources"; p /= CONFIGURATION_FILE; Toolbox::ReadFile(content, p.string()); @@ -59,7 +59,7 @@ Toolbox::ReadFile(content, CONFIGURATION_FILE); #endif } - catch (PalantirException&) + catch (PalanthirException&) { // No configuration file found, give up with empty configuration return; @@ -69,12 +69,12 @@ Json::Reader reader; if (!reader.parse(content, *configuration_)) { - throw PalantirException("Unable to read the configuration file"); + throw PalanthirException("Unable to read the configuration file"); } } - void PalantirInitialize(const char* configurationFile) + void PalanthirInitialize(const char* configurationFile) { boost::mutex::scoped_lock lock(globalMutex_); ReadGlobalConfiguration(configurationFile); @@ -83,7 +83,7 @@ - void PalantirFinalize() + void PalanthirFinalize() { boost::mutex::scoped_lock lock(globalMutex_); curl_global_cleanup(); @@ -150,14 +150,14 @@ if (!configuration_->isMember("DicomModalities")) { - throw PalantirException(""); + throw PalanthirException(""); } const Json::Value& modalities = (*configuration_) ["DicomModalities"]; if (modalities.type() != Json::objectValue || !modalities.isMember(name)) { - throw PalantirException(""); + throw PalanthirException(""); } try @@ -168,7 +168,7 @@ } catch (...) { - throw PalantirException("Badly formatted DICOM modality"); + throw PalanthirException("Badly formatted DICOM modality"); } } @@ -188,7 +188,7 @@ const Json::Value& modalities = (*configuration_) ["DicomModalities"]; if (modalities.type() != Json::objectValue) { - throw PalantirException("Badly formatted list of DICOM modalities"); + throw PalanthirException("Badly formatted list of DICOM modalities"); } Json::Value::Members members = modalities.getMemberNames(); @@ -198,7 +198,7 @@ { if (!isalnum(members[i][j]) && members[i][j] != '-') { - throw PalantirException("Only alphanumeric and dash characters are allowed in the names of the modalities"); + throw PalanthirException("Only alphanumeric and dash characters are allowed in the names of the modalities"); } } @@ -222,7 +222,7 @@ const Json::Value& users = (*configuration_) ["RegisteredUsers"]; if (users.type() != Json::objectValue) { - throw PalantirException("Badly formatted list of users"); + throw PalanthirException("Badly formatted list of users"); } Json::Value::Members usernames = users.getMemberNames();
--- a/PalanthirServer/PalanthirInitialization.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/PalanthirInitialization.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,11 +25,11 @@ #include <json/json.h> #include "../Core/HttpServer/MongooseServer.h" -namespace Palantir +namespace Palanthir { - void PalantirInitialize(const char* configurationFile = NULL); + void PalanthirInitialize(const char* configurationFile = NULL); - void PalantirFinalize(); + void PalanthirFinalize(); std::string GetGlobalStringParameter(const std::string& parameter, const std::string& defaultValue);
--- a/PalanthirServer/PalanthirRestApi.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/PalanthirRestApi.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -18,9 +18,9 @@ **/ -#include "PalantirRestApi.h" +#include "PalanthirRestApi.h" -#include "PalantirInitialization.h" +#include "PalanthirInitialization.h" #include "FromDcmtkBridge.h" #include "../Core/Uuid.h" @@ -28,7 +28,7 @@ #include <dcmtk/dcmdata/dcfilefo.h> #include <boost/lexical_cast.hpp> -namespace Palantir +namespace Palanthir { static void SendJson(HttpOutput& output, const Json::Value& value) @@ -96,15 +96,15 @@ Json::Reader reader; if (!reader.parse(s, source)) { - throw PalantirException("Corrupted JSON file"); + throw PalanthirException("Corrupted JSON file"); } SimplifyTagsRecursion(target, source); } - bool PalantirRestApi::Store(Json::Value& result, - const std::string& postData) + bool PalanthirRestApi::Store(Json::Value& result, + const std::string& postData) { // Prepare an input stream for the memory buffer DcmInputBufferStream is; @@ -156,21 +156,21 @@ return false; } - void PalantirRestApi::ConnectToModality(DicomUserConnection& c, - const std::string& name) + void PalanthirRestApi::ConnectToModality(DicomUserConnection& c, + const std::string& name) { std::string aet, address; int port; GetDicomModality(name, aet, address, port); - c.SetLocalApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "PALANTIR")); + c.SetLocalApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "PALANTHIR")); c.SetDistantApplicationEntityTitle(aet); c.SetDistantHost(address); c.SetDistantPort(port); c.Open(); } - bool PalantirRestApi::MergeQueryAndTemplate(DicomMap& result, - const std::string& postData) + bool PalanthirRestApi::MergeQueryAndTemplate(DicomMap& result, + const std::string& postData) { Json::Value query; Json::Reader reader; @@ -191,9 +191,9 @@ return true; } - bool PalantirRestApi::DicomFindPatient(Json::Value& result, - DicomUserConnection& c, - const std::string& postData) + bool PalanthirRestApi::DicomFindPatient(Json::Value& result, + DicomUserConnection& c, + const std::string& postData) { DicomMap m; DicomMap::SetupFindPatientTemplate(m); @@ -208,9 +208,9 @@ return true; } - bool PalantirRestApi::DicomFindStudy(Json::Value& result, - DicomUserConnection& c, - const std::string& postData) + bool PalanthirRestApi::DicomFindStudy(Json::Value& result, + DicomUserConnection& c, + const std::string& postData) { DicomMap m; DicomMap::SetupFindStudyTemplate(m); @@ -231,9 +231,9 @@ return true; } - bool PalantirRestApi::DicomFindSeries(Json::Value& result, - DicomUserConnection& c, - const std::string& postData) + bool PalanthirRestApi::DicomFindSeries(Json::Value& result, + DicomUserConnection& c, + const std::string& postData) { DicomMap m; DicomMap::SetupFindSeriesTemplate(m); @@ -255,9 +255,9 @@ return true; } - bool PalantirRestApi::DicomFind(Json::Value& result, - DicomUserConnection& c, - const std::string& postData) + bool PalanthirRestApi::DicomFind(Json::Value& result, + DicomUserConnection& c, + const std::string& postData) { DicomMap m; DicomMap::SetupFindPatientTemplate(m); @@ -325,9 +325,9 @@ - bool PalantirRestApi::DicomStore(Json::Value& result, - DicomUserConnection& c, - const std::string& postData) + bool PalanthirRestApi::DicomStore(Json::Value& result, + DicomUserConnection& c, + const std::string& postData) { Json::Value found(Json::objectValue); @@ -371,8 +371,8 @@ } - PalantirRestApi::PalantirRestApi(ServerIndex& index, - const std::string& path) : + PalanthirRestApi::PalanthirRestApi(ServerIndex& index, + const std::string& path) : index_(index), storage_(path) { @@ -380,7 +380,7 @@ } - void PalantirRestApi::Handle( + void PalanthirRestApi::Handle( HttpOutput& output, const std::string& method, const UriComponents& uri, @@ -426,7 +426,7 @@ } else { - output.SendHeader(Palantir_HttpStatus_415_UnsupportedMediaType); + output.SendHeader(Palanthir_HttpStatus_415_UnsupportedMediaType); return; } } @@ -595,13 +595,13 @@ } else { - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } output.AnswerBufferWithContentType(png, "image/png"); return; } - catch (PalantirException&) + catch (PalanthirException&) { output.Redirect("/app/images/Unsupported.png"); return; @@ -629,7 +629,7 @@ } catch (boost::bad_lexical_cast) { - output.SendHeader(Palantir_HttpStatus_400_BadRequest); + output.SendHeader(Palanthir_HttpStatus_400_BadRequest); return; } @@ -640,7 +640,7 @@ if (!index_.GetChanges(result, since, filter, limit)) { - output.SendHeader(Palantir_HttpStatus_400_BadRequest); + output.SendHeader(Palanthir_HttpStatus_400_BadRequest); return; } @@ -730,7 +730,7 @@ (uri[2] == "find" && !DicomFind(result, connection, postData)) || (uri[2] == "store" && !DicomStore(result, connection, postData))) { - output.SendHeader(Palantir_HttpStatus_400_BadRequest); + output.SendHeader(Palanthir_HttpStatus_400_BadRequest); return; } } @@ -744,7 +744,7 @@ } else { - output.SendHeader(Palantir_HttpStatus_404_NotFound); + output.SendHeader(Palanthir_HttpStatus_404_NotFound); } } }
--- a/PalanthirServer/PalanthirRestApi.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/PalanthirRestApi.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -27,9 +27,9 @@ #include <set> -namespace Palantir +namespace Palanthir { - class PalantirRestApi : public HttpHandler + class PalanthirRestApi : public HttpHandler { private: typedef std::set<std::string> Modalities; @@ -68,8 +68,8 @@ const std::string& postData); public: - PalantirRestApi(ServerIndex& index, - const std::string& path); + PalanthirRestApi(ServerIndex& index, + const std::string& path); virtual bool IsServedUri(const UriComponents& uri) {
--- a/PalanthirServer/ServerIndex.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/ServerIndex.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -20,7 +20,7 @@ #include "ServerIndex.h" -using namespace Palantir; +using namespace Palanthir; #ifndef NOMINMAX #define NOMINMAX @@ -36,7 +36,7 @@ #include <boost/lexical_cast.hpp> #include <stdio.h> -namespace Palantir +namespace Palanthir { namespace Internals { @@ -109,7 +109,7 @@ case 3: return "series"; default: - throw PalantirException(ErrorCode_InternalError); + throw PalanthirException(ErrorCode_InternalError); } } @@ -526,7 +526,7 @@ return StoreStatus_Success; //t.Rollback(); } - catch (PalantirException& e) + catch (PalanthirException& e) { std::cout << "EXCEPT2 [" << e.What() << "]" << " " << db_.GetErrorMessage() << std::endl; }
--- a/PalanthirServer/ServerIndex.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/ServerIndex.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -26,7 +26,7 @@ #include "../Core/FileStorage.h" -namespace Palantir +namespace Palanthir { enum SeriesStatus {
--- a/PalanthirServer/ToDcmtkBridge.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/ToDcmtkBridge.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -25,7 +25,7 @@ #include <dcmtk/dcmnet/diutil.h> -namespace Palantir +namespace Palanthir { DcmTagKey ToDcmtkBridge::Convert(const DicomTag& tag) {
--- a/PalanthirServer/ToDcmtkBridge.h Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/ToDcmtkBridge.h Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -24,7 +24,7 @@ #include <dcmtk/dcmdata/dcdatset.h> -namespace Palantir +namespace Palanthir { class ToDcmtkBridge {
--- a/PalanthirServer/main.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/PalanthirServer/main.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -1,5 +1,5 @@ /** - * Palantir - A Lightweight, RESTful DICOM Store + * Palanthir - A Lightweight, RESTful DICOM Store * Copyright (C) 2012 Medical Physics Department, CHU of Liege, * Belgium * @@ -18,7 +18,7 @@ **/ -#include "PalantirRestApi.h" +#include "PalanthirRestApi.h" #include <stdio.h> @@ -26,10 +26,10 @@ #include "../Core/HttpServer/FilesystemHttpHandler.h" #include "../Core/HttpServer/MongooseServer.h" #include "DicomProtocol/DicomServer.h" -#include "PalantirInitialization.h" +#include "PalanthirInitialization.h" -using namespace Palantir; +using namespace Palanthir; class MyDicomStore : public IStoreRequestHandler @@ -99,14 +99,14 @@ { if (argc >= 2) { - PalantirInitialize(argv[1]); + PalanthirInitialize(argv[1]); } else { - PalantirInitialize(); + PalanthirInitialize(); } - std::string storageDirectory = GetGlobalStringParameter("StorageDirectory", "PalantirStorage"); + std::string storageDirectory = GetGlobalStringParameter("StorageDirectory", "PalanthirStorage"); ServerIndex index(storageDirectory); MyDicomStoreFactory storeScp(index, storageDirectory); @@ -116,7 +116,7 @@ dicomServer.SetCalledApplicationEntityTitleCheck(true); dicomServer.SetStoreRequestHandlerFactory(storeScp); dicomServer.SetPortNumber(GetGlobalIntegerParameter("DicomPort", 4242)); - dicomServer.SetApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "PALANTIR")); + dicomServer.SetApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "PALANTHIR")); // HTTP server MongooseServer httpServer; @@ -137,13 +137,13 @@ httpServer.SetSslEnabled(false); } -#if PALANTIR_STANDALONE == 1 - httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::PALANTIR_EXPLORER)); +#if PALANTHIR_STANDALONE == 1 + httpServer.RegisterHandler(new EmbeddedResourceHttpHandler("/app", EmbeddedResources::PALANTHIR_EXPLORER)); #else - httpServer.RegisterHandler(new FilesystemHttpHandler("/app", PALANTIR_PATH "/PalantirExplorer")); + httpServer.RegisterHandler(new FilesystemHttpHandler("/app", PALANTHIR_PATH "/PalanthirExplorer")); #endif - httpServer.RegisterHandler(new PalantirRestApi(index, storageDirectory)); + httpServer.RegisterHandler(new PalanthirRestApi(index, storageDirectory)); // GO !!! httpServer.Start(); @@ -158,12 +158,12 @@ storeScp.Done(); } - catch (PalantirException& e) + catch (PalanthirException& e) { std::cout << "EXCEPT [" << e.What() << "]" << std::endl; } - PalantirFinalize(); + PalanthirFinalize(); return 0; }
--- a/UnitTests/SQLite.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/UnitTests/SQLite.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -6,7 +6,7 @@ #include <sqlite3.h> -using namespace Palantir; +using namespace Palanthir; TEST(SQLite, Configuration)
--- a/UnitTests/SQLiteChromium.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/UnitTests/SQLiteChromium.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -7,7 +7,7 @@ #include <sqlite3.h> -using namespace Palantir; +using namespace Palanthir; @@ -192,7 +192,7 @@ // handler to be called with SQLITE_MISMATCH as error code. SQLite::Statement s(db(), "INSERT INTO foo (a) VALUES (?)"); s.BindCString(0, "bad bad"); - EXPECT_THROW(s.Run(), PalantirException); + EXPECT_THROW(s.Run(), PalanthirException); } TEST_F(SQLStatementTest, Reset) { @@ -330,7 +330,7 @@ EXPECT_EQ(1, db().GetTransactionNesting()); { SQLite::Transaction inner3(db()); - EXPECT_THROW(inner3.Begin(), PalantirException); + EXPECT_THROW(inner3.Begin(), PalanthirException); EXPECT_EQ(1, db().GetTransactionNesting()); } }
--- a/UnitTests/Versions.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/UnitTests/Versions.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -27,7 +27,7 @@ } -#if PALANTIR_STATIC == 1 +#if PALANTHIR_STATIC == 1 TEST(Versions, ZlibStatic) { ASSERT_STREQ("1.2.7", zlibVersion()); @@ -57,7 +57,7 @@ // Check that SSL support is enabled when required bool curlSupportsSsl = vinfo->features & CURL_VERSION_SSL; -#if PALANTIR_SSL_ENABLED == 0 +#if PALANTHIR_SSL_ENABLED == 0 ASSERT_FALSE(curlSupportsSsl); #else ASSERT_TRUE(curlSupportsSsl);
--- a/UnitTests/main.cpp Wed Sep 05 15:38:08 2012 +0200 +++ b/UnitTests/main.cpp Wed Sep 05 15:50:12 2012 +0200 @@ -5,15 +5,15 @@ #include "../Core/Compression/ZlibCompressor.h" #include "../Core/DicomFormat/DicomTag.h" #include "../Core/FileStorage.h" -#include "../PalantirCppClient/HttpClient.h" +#include "../PalanthirCppClient/HttpClient.h" #include "../Core/HttpServer/HttpHandler.h" -#include "../Core/PalantirException.h" +#include "../Core/PalanthirException.h" #include "../Core/Toolbox.h" #include "../Core/Uuid.h" -#include "../PalantirServer/FromDcmtkBridge.h" -#include "../PalantirServer/PalantirInitialization.h" +#include "../PalanthirServer/FromDcmtkBridge.h" +#include "../PalanthirServer/PalanthirInitialization.h" -using namespace Palantir; +using namespace Palanthir; TEST(Uuid, Generation) @@ -186,8 +186,8 @@ ASSERT_EQ(1u, c.size()); ASSERT_EQ("hello", c[0]); - ASSERT_THROW(Toolbox::SplitUriComponents(c, ""), PalantirException); - ASSERT_THROW(Toolbox::SplitUriComponents(c, "a"), PalantirException); + ASSERT_THROW(Toolbox::SplitUriComponents(c, ""), PalanthirException); + ASSERT_THROW(Toolbox::SplitUriComponents(c, "a"), PalanthirException); } @@ -275,9 +275,9 @@ int main(int argc, char **argv) { - PalantirInitialize(); + PalanthirInitialize(); ::testing::InitGoogleTest(&argc, argv); int result = RUN_ALL_TESTS(); - PalantirFinalize(); + PalanthirFinalize(); return result; }