Skip to content

Commit 0a58f2f

Browse files
committed
Add parser
1 parent 1dd1468 commit 0a58f2f

29 files changed

+24441
-1
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
wsjcpp-geoip
2+
tmp/*
3+
14
# Prerequisites
25
*.d
36

.travis.yml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
language: cpp
2+
3+
branches:
4+
only:
5+
- master
6+
7+
dist: bionic
8+
9+
addons:
10+
apt:
11+
packages:
12+
- cmake
13+
- make
14+
- g++
15+
- pkg-config
16+
17+
# Build steps
18+
script:
19+
- ./build_simple.sh
20+
- cd unit-tests.wsjcpp
21+
- ./build_simple.sh
22+
- ./unit-tests
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
wsjcpp_version: v0.0.1
2+
cmake_cxx_standard: 11
3+
cmake_minimum_required: 3.0
4+
5+
name: wsjcpp/wsjcpp-core
6+
version: v0.0.3
7+
description: Basic Utils for wsjcpp
8+
issues: https://github.com/wsjcpp/wsjcpp-core/issues
9+
repositories:
10+
- type: main
11+
url: "https://github.com/wsjcpp/wsjcpp-core"
12+
keywords:
13+
- c++
14+
- wsjcpp
15+
16+
authors:
17+
- name: Evgenii Sopov
18+
19+
20+
required-libraries:
21+
- pthread
22+
23+
distribution:
24+
- source-file: src/wsjcpp_core.cpp
25+
target-file: wsjcpp_core.cpp
26+
sha1: "04a9e3c6db3c7190c6589514a4b5957dbb4c366d"
27+
type: "source-code"
28+
- source-file: src/wsjcpp_core.h
29+
target-file: wsjcpp_core.h
30+
sha1: "1d76447c6880f43f9afeca89111ec64d3574ccb7"
31+
type: "source-code"
32+
33+
unit-tests:
34+
folder: unit-tests # default
35+
files:
36+
- unit-tests/src/main.cpp
37+
- unit-tests/src/unit_tests.h
38+
- unit-tests/src/unit_tests.cpp
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2020-01-26 15:25:47.076, 0x7f5b38179780 [INFO] ArgumentProcessorReinstall: Try reinstalling 'https://github.com/wsjcpp/wsjcpp-core:master' package...
2+
2020-01-26 15:25:47.076, 0x7f5b38179780 [INFO] WSJCppPackageManager: sUrl: 'https://raw.githubusercontent.com/wsjcpp/wsjcpp-core/master//wsjcpp.yml'
3+
2020-01-26 15:25:47.076, 0x7f5b38179780 [INFO] WSJCppPackageManager: sPath: './.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml'
4+
2020-01-26 15:25:48.046, 0x7f5b38179780 [ERR] WSJCppPackageManager: Missing required field 'cases' in './.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml' (./.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml:32): unit-tests:
5+
2020-01-26 15:25:48.046, 0x7f5b38179780 [ERR] WSJCppPackageManager: Could not load ./.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master
6+
2020-01-26 15:25:48.046, 0x7f5b38179780 [ERR] ArgumentProcessorReinstall: Could not reinstall 'https://github.com/wsjcpp/wsjcpp-core:master' package.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2020-01-26 15:25:55.257, 0x7fb4122a2780 [INFO] ArgumentProcessorReinstall: Try reinstalling 'https://github.com/wsjcpp/wsjcpp-core:master' package...
2+
2020-01-26 15:25:55.257, 0x7fb4122a2780 [INFO] WSJCppPackageManager: sUrl: 'https://raw.githubusercontent.com/wsjcpp/wsjcpp-core/master//wsjcpp.yml'
3+
2020-01-26 15:25:55.257, 0x7fb4122a2780 [INFO] WSJCppPackageManager: sPath: './.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml'
4+
2020-01-26 15:25:56.063, 0x7fb4122a2780 [ERR] WSJCppPackageManager: Missing required field 'cases' in './.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml' (./.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml:32): unit-tests:
5+
2020-01-26 15:25:56.063, 0x7fb4122a2780 [ERR] WSJCppPackageManager: Could not load ./.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master
6+
2020-01-26 15:25:56.064, 0x7fb4122a2780 [ERR] ArgumentProcessorReinstall: Could not reinstall 'https://github.com/wsjcpp/wsjcpp-core:master' package.
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2020-01-26 15:28:29.952, 0x7f9bcafed780 [ERR] WSJCppPackageManagerUnitTest: Missing required field 'url' in (./wsjcpp.yml:43): - name: ParserIpApiCom
2+
2020-01-26 15:28:29.952, 0x7f9bcafed780 [INFO] ArgumentProcessorReinstall: Try reinstalling 'https://github.com/wsjcpp/wsjcpp-core:master' package...
3+
2020-01-26 15:28:29.952, 0x7f9bcafed780 [INFO] WSJCppPackageManager: sUrl: 'https://raw.githubusercontent.com/wsjcpp/wsjcpp-core/master//wsjcpp.yml'
4+
2020-01-26 15:28:29.952, 0x7f9bcafed780 [INFO] WSJCppPackageManager: sPath: './.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml'
5+
2020-01-26 15:28:30.775, 0x7f9bcafed780 [ERR] WSJCppPackageManager: Missing required field 'cases' in './.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml' (./.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master/wsjcpp.hold.yml:32): unit-tests:
6+
2020-01-26 15:28:30.775, 0x7f9bcafed780 [ERR] WSJCppPackageManager: Could not load ./.wsjcpp/cache/https___github_com_wsjcpp_wsjcpp_core_master
7+
2020-01-26 15:28:30.775, 0x7f9bcafed780 [ERR] ArgumentProcessorReinstall: Could not reinstall 'https://github.com/wsjcpp/wsjcpp-core:master' package.

CMakeLists.txt

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
cmake_minimum_required(VERSION 3.0)
2+
3+
project(wsjcpp-geoip)
4+
5+
include(${CMAKE_CURRENT_SOURCE_DIR}/src.wsjcpp/CMakeLists.txt)
6+
7+
set(CMAKE_CXX_STANDARD 11)
8+
set(EXECUTABLE_OUTPUT_PATH ${wsjcpp-geoip_SOURCE_DIR})
9+
10+
# Sources
11+
12+
# include header dirs
13+
list (APPEND WSJCPP_INCLUDE_DIRS "src")
14+
15+
list (APPEND WSJCPP_SOURCES "src/wsjcpp_geoip.cpp")
16+
list (APPEND WSJCPP_SOURCES "src/wsjcpp_geoip.h")
17+
18+
list (APPEND WSJCPP_SOURCES "src/main.cpp")
19+
20+
include_directories(${WSJCPP_INCLUDE_DIRS})
21+
22+
add_executable (wsjcpp-geoip ${WSJCPP_SOURCES})
23+
24+
target_link_libraries(wsjcpp-geoip ${WSJCPP_LIBRARIES} )
25+
26+
install(
27+
TARGETS
28+
wsjcpp-geoip
29+
RUNTIME DESTINATION
30+
/usr/bin
31+
)

README.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
# wsjcpp-geoip
2-
C++ Geolation over IP-address (Colelction of service)
2+
3+
[![Build Status](https://api.travis-ci.org/wsjcpp/wsjcpp-geoip.svg?branch=master)](https://travis-ci.org/wsjcpp/wsjcpp-geoip) [![Github Stars](https://img.shields.io/github/stars/wsjcpp/wsjcpp-geoip.svg?label=github%20%E2%98%85)](https://github.com/wsjcpp/wsjcpp-geoip) [![Github Stars](https://img.shields.io/github/contributors/wsjcpp/wsjcpp-geoip.svg)](https://github.com/wsjcpp/wsjcpp-geoip) [![Github Forks](https://img.shields.io/github/forks/wsjcpp/wsjcpp-geoip.svg?label=github%20forks)](https://github.com/wsjcpp/wsjcpp-geoip/network/members)
4+
5+
C++. Call request to another services for get location coordinates by IP-address
6+
7+
Example:
8+
```
9+
```

build_simple.sh

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
3+
if [ ! -d tmp ]; then
4+
mkdir -p tmp
5+
fi
6+
7+
cd tmp
8+
cmake ..
9+
make

src.wsjcpp/.gitkeep

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

src.wsjcpp/CMakeLists.txt

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Automaticly generated by [email protected]
2+
cmake_minimum_required(VERSION 3.0)
3+
4+
add_definitions(-DWSJCPP_VERSION="v0.0.1")
5+
add_definitions(-DWSJCPP_NAME="wsjcpp-storages")
6+
7+
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
8+
set(MACOSX TRUE)
9+
endif()
10+
11+
set(CMAKE_CXX_STANDARD 11)
12+
13+
set (WSJCPP_LIBRARIES "")
14+
set (WSJCPP_INCLUDE_DIRS "")
15+
set (WSJCPP_SOURCES "")
16+
17+
# wsjcpp/wsjcpp-core:v0.0.3
18+
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/wsjcpp_wsjcpp_core/")
19+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_wsjcpp_core/wsjcpp_core.cpp")
20+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/wsjcpp_wsjcpp_core/wsjcpp_core.h")
21+
22+
# nlohmann/json:v3.7.3
23+
list (APPEND WSJCPP_INCLUDE_DIRS "./src.wsjcpp/nlohmann_json/")
24+
list (APPEND WSJCPP_SOURCES "./src.wsjcpp/nlohmann_json/json.hpp")
25+
26+
# required-libraries
27+
list (APPEND WSJCPP_LIBRARIES "-lpthread")
28+
29+
# required-pkg-config
30+
## CURL
31+
FIND_PACKAGE(CURL)
32+
IF(CURL_FOUND)
33+
list (APPEND WSJCPP_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
34+
list (APPEND WSJCPP_LIBRARIES ${CURL_LIBRARIES})
35+
ELSE(CURL_FOUND)
36+
MESSAGE(FATAL_ERROR "Could not find the CURL library and development files.")
37+
ENDIF(CURL_FOUND)
38+
39+

0 commit comments

Comments
 (0)