Skip to content

Commit

Permalink
update Analyze (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
denty authored Jun 12, 2024
1 parent 04338a5 commit 57c1257
Show file tree
Hide file tree
Showing 83 changed files with 4,901 additions and 0 deletions.
3 changes: 3 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/.idea/GaiaXAnalyze.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cmake.configureOnOpen": false
}
11 changes: 11 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/GXAnalyzeCore/.gitignore
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
48 changes: 48 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/GXAnalyzeCore/CMakeLists.txt
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 ()
46 changes: 46 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/GXAnalyzeCore/GXATSNode.cpp
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;
}
40 changes: 40 additions & 0 deletions GaiaXHarmony/GaiaXAnalyze/GXAnalyzeCore/GXATSNode.h
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_*/
Loading

0 comments on commit 57c1257

Please sign in to comment.