Commit f28524d1 authored by Jan Köster's avatar Jan Köster
Browse files

added gitignore file

parent ad0e8f20
Loading
Loading
Loading
Loading

.gitignore

0 → 100644
+2 −0
Changes for .gitignore: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
out
.vs
 No newline at end of file

CMakeSettings.json

0 → 100644
+42 −0
Changes for CMakeSettings.json: 42 added lines, 0 removed lines.
Original line number Diff line number Diff line
{
  "configurations": [
    {
      "name": "Linux-Clang-Debug",
      "generator": "Ninja",
      "configurationType": "Debug",
      "cmakeExecutable": "cmake",
      "remoteCopySourcesExclusionList": [ ".vs", ".git", "out" ],
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "inheritEnvironments": [ "linux_clang_x64" ],
      "remoteMachineName": "-468509905;10.1.2.209 (username=root, port=22, authentication=Password)",
      "remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/src",
      "remoteBuildRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/build/${name}",
      "remoteInstallRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/install/${name}",
      "remoteCopySources": true,
      "rsyncCommandArgs": "-t --delete",
      "remoteCopyBuildOutput": false,
      "remoteCopySourcesMethod": "rsync"
    },
    {
      "name": "Linux-Clang-Release",
      "generator": "Ninja",
      "configurationType": "RelWithDebInfo",
      "cmakeExecutable": "cmake",
      "remoteCopySourcesExclusionList": [ ".vs", ".git", "out" ],
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "inheritEnvironments": [ "linux_clang_x64" ],
      "remoteMachineName": "-468509905;10.1.2.209 (username=root, port=22, authentication=Password)",
      "remoteCMakeListsRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/src",
      "remoteBuildRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/build/${name}",
      "remoteInstallRoot": "$HOME/.vs/${projectDirName}/${workspaceHash}/out/install/${name}",
      "remoteCopySources": true,
      "rsyncCommandArgs": "-t --delete",
      "remoteCopyBuildOutput": false,
      "remoteCopySourcesMethod": "rsync"
    }
  ]
}
 No newline at end of file
+2 −2
Changes for src/CMakeLists.txt: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -23,8 +23,8 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
  target_link_libraries(htmlpp ${OPENSSL_LIBRARIES} wsock32 ws2_32)
  target_link_libraries(htmlpp-static ${OPENSSL_LIBRARIES} wsock32 ws2_32)
ELSE()
  target_link_libraries(htmlpp ${OPENSSL_LIBRARIES} pthread)
  target_link_libraries(htmlpp-static ${OPENSSL_LIBRARIES} pthread)    
  target_link_libraries(htmlpp ${OPENSSL_LIBRARIES} pthread systempp)
  target_link_libraries(htmlpp-static ${OPENSSL_LIBRARIES} pthread systempp)    
ENDIF()

SET(CMAKE_INSTALL_LIBDIR lib CACHE PATH "Output directory for libraries")
+7 −62
Changes for src/exception.cpp: 7 added lines, 62 removed lines.
Original line number Diff line number Diff line
@@ -30,83 +30,31 @@
#include "utils.h"
#include "exception.h"

libhtmlpp::HTMLException::Message::Message(){
    _Buffer=nullptr;
    _BufferSize=0;
    _nextMessage=nullptr;
}

libhtmlpp::HTMLException::Message::~Message(){
    delete[] _Buffer;
    delete   _nextMessage;
}

libhtmlpp::HTMLException::HTMLException(){
    _curCType=Note;
    _firstMessage=nullptr;
    _lastMessage=nullptr;
    _printBuffer=nullptr;
libhtmlpp::HTMLException::HTMLException() : sys::SystemException(){
};

libhtmlpp::HTMLException::HTMLException(const HTMLException &exp){
    _curCType=exp._curCType;
    _firstMessage=nullptr;
    _lastMessage=nullptr;
    _printBuffer=nullptr;
    for(Message *curmsg=exp._firstMessage; curmsg; curmsg=curmsg->_nextMessage){
        *this << curmsg->_Buffer;
    }
libhtmlpp::HTMLException::HTMLException(const HTMLException &exp) : sys::SystemException(exp){
}

libhtmlpp::HTMLException::~HTMLException(){
    delete[] _printBuffer;
    delete _firstMessage;
}

int libhtmlpp::HTMLException::getErrorType(){
    return _curCType; 
    return curCType; 
}

const char* libhtmlpp::HTMLException::what(){
    size_t bufsize=0,written=0;
    for(Message *curmsg=_firstMessage; curmsg; curmsg=curmsg->_nextMessage){
        bufsize+=curmsg->_BufferSize;
    }
    delete[] _printBuffer;
    _printBuffer = new char[bufsize+1];
    for(Message *curmsg=_firstMessage; curmsg; curmsg=curmsg->_nextMessage){
        scopy(curmsg->_Buffer,curmsg->_Buffer+curmsg->_BufferSize,_printBuffer+written);
        written+=curmsg->_BufferSize;
    }
    _printBuffer[bufsize]='\0';
    
    return _printBuffer;
    return sys::SystemException::what();
}

const libhtmlpp::HTMLException & libhtmlpp::HTMLException::Exception() throw(){
    return *this;
}


libhtmlpp::HTMLException& libhtmlpp::HTMLException::asign(const char *src){
    if(!src)
        return *this;
    if(!_firstMessage){
        _firstMessage=new Message();
        _lastMessage=_firstMessage;
    }else{
        _lastMessage->_nextMessage=new Message();
        _lastMessage=_lastMessage->_nextMessage;
    }
    _lastMessage->_CType=_curCType;
    _lastMessage->_BufferSize=getlen(src);
    _lastMessage->_Buffer=new char[_lastMessage->_BufferSize+1];
    scopy(src,src+_lastMessage->_BufferSize+1,_lastMessage->_Buffer);
    sys::SystemException::asign(src);
    return *this;   
}

libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator[](int errtype){
    _curCType=errtype;
    curCType=errtype;
    return *this;
}

@@ -115,9 +63,6 @@ libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator<<(const char *src){
};

libhtmlpp::HTMLException& libhtmlpp::HTMLException::operator<<(int src){
    char *buf=new char[sizeof(int)+1];
    itoa(src,buf);
    asign(buf);
    delete[] buf;
    sys::SystemException::operator<<(src);
    return *this;
}
+4 −22
Changes for src/exception.h: 4 added lines, 22 removed lines.
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@

#include <stddef.h>

#include "config.h"
#include "system.h"

/*
@@ -38,8 +37,9 @@
 * Critical: Some happend that will shutdown your Apllication
 */

#ifndef EXCEPTION_H
#define EXCEPTION_H
#include <systempp/sysexception.h>

#pragma once

#ifdef DEBUG

@@ -47,7 +47,7 @@

namespace libhtmlpp {
    
    class HTMLException {
    class HTMLException : public sys::SystemException{
    public:
        
        HTMLException();
@@ -58,30 +58,12 @@ namespace libhtmlpp {
        
        const char* what();
        
        const HTMLException& Exception() throw();
        
        enum Type {Note,Warning,Error,Critical};
        
        HTMLException& asign(const char *src);
        HTMLException& operator[](int errtype);
        HTMLException& operator<<(const char *src);
        HTMLException& operator<<(int src);
    private:
        struct Message {
            Message();
            ~Message();
            char    *_Buffer;
            size_t   _BufferSize;        
            int      _CType;
            Message *_nextMessage;
        };
        
        Message *_firstMessage;
        Message *_lastMessage;
        
        char    *_printBuffer;
        int      _curCType;
    };
};
#endif
Loading