-
Notifications
You must be signed in to change notification settings - Fork 143
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
83 changed files
with
4,901 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"cmake.configureOnOpen": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
.idea | ||
cmake-build-debug | ||
.vscode | ||
CMakeFiles | ||
*.a | ||
cmake_install.cmake | ||
Makefile | ||
CMakeCache.txt | ||
CMakeFiles | ||
*.cbp | ||
*.dylib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
|
||
# 设置cmake最低版本 | ||
cmake_minimum_required(VERSION 3.4.1) | ||
|
||
# 设置库名称 | ||
project(GXAnalyzeCore) | ||
|
||
# 指定C++版本 | ||
set(CMAKE_CXX_STANDARD 11) | ||
|
||
if (${CMAKE_BUILD_TYPE} EQUAL "Release") | ||
#编译包大小优化选项 如表达式需要debug,请把以下五个编译选项注释掉 | ||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Oz -flto -fdata-sections -ffunction-sections") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Oz -flto -fdata-sections -ffunction-sections -s") | ||
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -O3 -flto -Wl,--gc-sections -Wl,-s") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC") | ||
else () | ||
# nothing | ||
endif () | ||
|
||
# 设置根目录 | ||
get_filename_component(CORE_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../ ABSOLUTE) | ||
|
||
# 设置库 | ||
add_library(${PROJECT_NAME} SHARED | ||
GXAnalyze.cpp | ||
GXATSNode.cpp | ||
GXWordAnalyze.cpp | ||
) | ||
|
||
# 链接头文件 | ||
target_include_directories(${PROJECT_NAME} PRIVATE | ||
# 引入自有代码头文件 | ||
${CMAKE_CURRENT_SOURCE_DIR} | ||
) | ||
|
||
# 链接子模块 | ||
target_link_libraries(${PROJECT_NAME}) | ||
|
||
# 链接模块 | ||
if (${CMAKE_SYSTEM_NAME} MATCHES "Android") | ||
|
||
target_link_libraries(${PROJECT_NAME} | ||
-landroid | ||
-llog | ||
) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2021, Alibaba Group Holding Limited; | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#include "GXATSNode.h" | ||
|
||
using namespace std; | ||
|
||
GXATSNode::GXATSNode() { | ||
} | ||
|
||
GXATSNode::GXATSNode(string name, string detail, string token) { | ||
GXATSNode::name = name; //字段 | ||
GXATSNode::detail = detail; //code | ||
GXATSNode::token = token; //类型 | ||
} | ||
|
||
GXATSNode::~GXATSNode() { | ||
|
||
} | ||
|
||
GXATSNode &GXATSNode::operator=(const GXATSNode &node) { | ||
GXATSNode::name = node.name; | ||
GXATSNode::detail = node.detail; | ||
GXATSNode::token = node.token; | ||
GXATSNode::count = node.count; | ||
return *this; | ||
} | ||
|
||
GXATSNode::GXATSNode(string name, string detail, string token, int count) { | ||
GXATSNode::name = name; //字段 | ||
GXATSNode::detail = detail; //code | ||
GXATSNode::token = token; //类型 | ||
GXATSNode::count = count; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright (c) 2021, Alibaba Group Holding Limited; | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
#ifndef _ATSNODE__H_ | ||
#define _ATSNODE__H_ | ||
|
||
#include <string> | ||
#include <iostream> | ||
|
||
using namespace std; | ||
|
||
class GXATSNode { | ||
public: | ||
GXATSNode(); //无参构造函数 | ||
GXATSNode(string name, string detail, string token); //有参构造函数 | ||
GXATSNode(string name, string detail, string token,int count); //有参构造函数 | ||
~GXATSNode(); //析构函数 | ||
GXATSNode &operator=(const GXATSNode &node); | ||
|
||
string name; //字段 | ||
string token; //类型 | ||
string detail; | ||
int count; | ||
|
||
private: | ||
}; | ||
|
||
#endif /*include _ATSNODE__H_*/ |
Oops, something went wrong.