Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
yksten committed Aug 3, 2021
1 parent ab8c44a commit a1227a4
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 25 deletions.
18 changes: 9 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PROJECT(serialize)
PROJECT(struct2x)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
INCLUDE(CheckIncludeFileCXX)

Expand All @@ -14,33 +14,33 @@ INCLUDE_DIRECTORIES(./ ./include/)
AUX_SOURCE_DIRECTORY(. DIR_SRCS)

# json
SET(JSON "./include/json/GenericReader.h" "./thirdParty/json/GenericReader.cpp" "./include/json/GenericWriter.h" "./thirdParty/json/GenericWriter.cpp")
SET(JSON "./include/struct2x/json/GenericReader.h" "./thirdParty/json/GenericReader.cpp" "./include/struct2x/json/GenericWriter.h" "./thirdParty/json/GenericWriter.cpp")
SOURCE_GROUP("thirdParty\\json" FILES ${JSON})

# serialize
SET(INCLUDE "./include/serialize.h")
# struct2x
SET(INCLUDE "./include/struct2x/serialize.h")
SOURCE_GROUP(include FILES ${INCLUDE})

# json
SET(INCLUDEJSON "./include/json/encoder.h" "./include/json/decoder.h")
SET(INCLUDEJSON "./include/struct2x/json/encoder.h" "./include/struct2x/json/decoder.h")
SOURCE_GROUP("include\\json" FILES ${INCLUDEJSON})

# protobuf
SET(INCLUDEPROTOBUF "./include/protobuf/encoder.h" "./include/protobuf/decoder.h")
SET(INCLUDEPROTOBUF "./include/struct2x/protobuf/encoder.h" "./include/struct2x/protobuf/decoder.h")
SOURCE_GROUP("include\\protobuf" FILES ${INCLUDEPROTOBUF})
SET(SRCPROTOBUF "./src/protobuf/encoder.cpp" "./src/protobuf/decoder.cpp")
SOURCE_GROUP("src\\protobuf" FILES ${SRCPROTOBUF})

LIST(REMOVE_ITEM DIR_SRCS "./tester/main.cpp")
IF (MSVC)
ADD_LIBRARY(serialize SHARED
ADD_LIBRARY(struct2x SHARED
${JSON}
${INCLUDE}
${INCLUDEJSON}
${INCLUDEPROTOBUF} ${SRCPROTOBUF}
${DIR_SRCS})
ELSE ()
ADD_LIBRARY(serialize
ADD_LIBRARY(struct2x
${JSON}
${INCLUDE}
${INCLUDEJSON}
Expand All @@ -54,5 +54,5 @@ if (${EXEC} STREQUAL ON)
SET(TESTER "./tester/main.cpp" "./tester/testStruct.h")
SOURCE_GROUP(tester FILES ${TESTER})
ADD_EXECUTABLE(tester ${TESTER})
TARGET_LINK_LIBRARIES(tester serialize)
TARGET_LINK_LIBRARIES(tester struct2x)
endif()
File renamed without changes.
File renamed without changes.
5 changes: 2 additions & 3 deletions include/json/decoder.h → include/struct2x/json/decoder.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#ifndef __JSON_DECODER_H__
#define __JSON_DECODER_H__

#include "serialize.h"
#include <string>
#include <map>

#include "json/GenericReader.h"
#include <struct2x/serialize.h>
#include <struct2x/json/GenericReader.h>


namespace serialize {
Expand Down
4 changes: 2 additions & 2 deletions include/json/encoder.h → include/struct2x/json/encoder.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#ifndef __JSON_ENCODER_H__
#define __JSON_ENCODER_H__
#include "serialize.h"
#include <vector>
#include <map>
#include "json/GenericWriter.h"
#include <struct2x/serialize.h>
#include <struct2x/json/GenericWriter.h>


namespace serialize {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <string>
#include <map>
#include "serialize.h"
#include <struct2x/serialize.h>


namespace proto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <assert.h>
#include <string>
#include <map>
#include "serialize.h"
#include <struct2x/serialize.h>

#define BEGINCALCULATEFIELD(buf) \
std::pair<bool, size_t> customField(buf.getCustomField());
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/protobuf/decoder.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "protobuf/decoder.h"
#include <struct2x/protobuf/decoder.h>


namespace proto {
Expand Down Expand Up @@ -214,4 +214,4 @@ namespace serialize {
return _msg->bind<proto::bin_type, std::vector<std::string> >(&PBDecoder::convertArray, v);
}

}
}
2 changes: 1 addition & 1 deletion src/protobuf/encoder.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "protobuf/encoder.h"
#include <struct2x/protobuf/encoder.h>
#include <assert.h>

namespace serialize {
Expand Down
8 changes: 4 additions & 4 deletions tester/main.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#include <iostream>
#include <assert.h>

#include "protobuf/encoder.h"
#include "protobuf/decoder.h"
#include <struct2x/protobuf/encoder.h>
#include <struct2x/protobuf/decoder.h>
#include "testStruct.h"

#include "json/encoder.h"
#include "json/decoder.h"
#include <struct2x/json/encoder.h>
#include <struct2x/json/decoder.h>


struct testStru {
Expand Down
2 changes: 1 addition & 1 deletion thirdParty/json/GenericReader.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "json/GenericReader.h"
#include <struct2x/json/GenericReader.h>
#include <assert.h>


Expand Down
2 changes: 1 addition & 1 deletion thirdParty/json/GenericWriter.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "json/GenericWriter.h"
#include <struct2x/json/GenericWriter.h>
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down

0 comments on commit a1227a4

Please sign in to comment.