Skip to content

Commit

Permalink
Merge pull request #9 from ElementAstro/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
AstroAir authored Jan 5, 2024
2 parents da8f0c2 + 47e228e commit 137bcba
Show file tree
Hide file tree
Showing 499 changed files with 31,814 additions and 13,888 deletions.
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ set(component_module
${lithium_component_dir}/device/device_utils.cpp
${lithium_component_dir}/device/hydrogen_device.cpp

${lithium_component_dir}/plugin/plugin_loader.cpp

${lithium_component_dir}/component_manager.cpp
)

Expand All @@ -146,6 +144,7 @@ set(task_module
${lithium_src_dir}/task/task_manager.cpp
${lithium_src_dir}/task/task_stack.cpp
${lithium_src_dir}/task/task_generator.cpp
${lithium_src_dir}/task/task_container.cpp
)

set(Lithium_module
Expand Down Expand Up @@ -228,7 +227,7 @@ target_link_libraries(lithium_server loguru)
target_link_libraries(lithium_server libzippp)
target_link_libraries(lithium_server atomstatic)

target_link_libraries(lithium_server lithiumcorestatic)
target_link_libraries(lithium_server atom.propertystatic)
target_link_libraries(lithium_server lithiumpluginstatic)
if(NOT WIN32)
target_link_libraries(lithium_server hydrogenclientstatic)
Expand Down
221 changes: 221 additions & 0 deletions STYLE_OF_CODE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,221 @@
# C++ Naming Conventions

## Variable Naming

- Use meaningful variable names that clearly express the purpose of the variable.
- Follow the camelCase convention for all code.
- camelCase: Start with a lowercase letter, and capitalize the first letter of subsequent words.

```cpp
int studentCount;
```

## Constant Naming

- Use uppercase letters and underscores to represent constants.

```cpp
const int MAX_STUDENTS = 100;
```

## Function Naming

- Use verb plus noun format to name functions.
- It is more important to have a readable name than a concise one.
- Follow the camelCase convention.

```cpp
void displayStudentInfo(const Student& student) {
//...
}
```
## Class Naming
- Use nouns or noun phrases to name classes.
- Follow the camelCase convention.
```cpp
class Student {
//...
};
```

## Class Member Variables

- Use nouns or noun phrases to name class member variables.
- Follow the camelCase convention.
- Limit the usage of class member variables. If necessary, declare them as private variables and prefix them with "m_".

```cpp
class Student {
int m_id;
string m_name;
//...
};
```
## Enum Type Naming
- Use uppercase letters and underscores to represent enum types.
```cpp
enum Color { RED, GREEN, BLUE };
```

## Namespace Naming

- Use PascalCase for namespace naming.
- Split components into separate namespaces instead of putting everything into a single namespace to avoid complexity.

```cpp
namespace Atom {
//...
}
```
## File Naming
- Use meaningful file names that clearly represent the content of the file.
- Use lowercase letters and underscores for file naming.
```cpp
student_info.cpp
```

- If there is a c++ header file, please use `.hpp` as the file extension.

```cpp
student_info.hpp
```

## Comments

- Use meaningful comments to explain the meaning and purpose of the code.
- Comments should be clear, concise, and kept up to date with the code.
- Prefer using Doxygen-style comments.

```cpp
/**
* @brief Display student information
* @param student Student information
*/
void displayStudentInfo(const Student& student) {
//...
}
```
## Summary
Good naming conventions improve code readability and maintainability, making it easier for others to understand and use your code.
# C++命名规则
## 变量命名
- 使用有意义的变量名,能够清晰表达变量用途。
- 所有代码建议采用驼峰命名法(camelCase)。
- 驼峰命名法:首字母小写,单词之间没有下划线,后续单词首字母大写。
```cpp
int studentCount;
```
## 常量命名
- 使用全大写字母和下划线来表示常量。
```cpp
const int MAX_STUDENTS = 100;
```

## 函数命名

- 使用动词加名词的形式来命名函数。
- 能够看懂比简洁的命名更加重要。
- 采用驼峰命名法。

```cpp
void displayStudentInfo(const Student& student) {
//...
}
```

## 类命名

- 使用名词或名词短语来命名类。
- 采用驼峰命名法。

```cpp
class Student {
//...
};
```
## 类内变量
- 使用名词或名词短语来命名类内变量。
- 采用驼峰命名法。
- 类内变量应该尽量少,如果需要使用类内变量,应该将其声明为私有变量,所有类内变量前面都要加上m_前缀。
```cpp
class Student {
int m_id;
string m_name;
//...
};
```

## 枚举类型命名

- 使用全大写字母和下划线来表示枚举类型。

```cpp
enum Color { RED, GREEN, BLUE };
```
## 命名空间命名
- 采用大驼峰命名法。
- 具体的拆分组件,不要所有东西集中在一个命名空间中,不然会非常复杂。
```cpp
namespace Atom {
//...
}
```

## 文件命名

- 使用有意义的文件名,能够清晰表达文件内容。
- 采用小写字母和下划线命名法。

```cpp
student_info.cpp
```

- 如果是c++头文件,请使用`.hpp`结尾。

```txt
student_info.hpp
```

## 注释

- 使用有意义的注释来解释代码的含义和目的。
- 注释应该清晰、简洁,并和代码保持同步。
- 最好使用Doxygen风格的注释。

```cpp
/**
* @brief 显示学生信息
* @param student 学生信息
*/
void displayStudentInfo(const Student& student) {
//...
}
```
## 总结
良好的命名规范能够提高代码的可读性和可维护性,帮助他人更容易理解和使用你的代码。
13 changes: 13 additions & 0 deletions client/.github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# These are supported funding model platforms

github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: http://cairuoyu.com/screenshots/pay.png
23 changes: 23 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.idea/
.vscode/
.dart_tool/
.gradle/
.packages
/build/
/ios/
/windows/
/test/
/integration_test/
/macos/
/linux/

*.iml
.metadata
pubspec.lock

.flutter-plugins
.flutter-plugins-dependencies
generated_plugin_registrant.dart

ignore_*
debug.log
21 changes: 21 additions & 0 deletions client/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 cairuoyu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 19 additions & 0 deletions client/PRIVACY
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
欢迎使用Flutter admin,我们非常重视用户的隐私权,具体细则如下:

一、隐私权政策适用范围
我们如何处理用户在登录及使用Flutter admin时留下的个人信息

二、信息收集
在您注册帐户后,通过个人信息功能,我们会收集您的个人信息资料,但这些信息是可以随意填写的,您可以不需要填写真实的信息。

三、信息公开与共享
我们不会将您的个人识别信息出租或出售给任何人。

四、Cookie
我们会在您的设备上设定或取用Cookie。

五、编辑个人帐户资料的权限
我们赋予您在任何时候编辑我们帐户信息和喜好的权利。

六、隐私权政策的修订
我们时常会对隐私权政策进行修改。如果在使用用户个人信息政策方面有大幅度修改时,我们会在系统显眼的位置贴出相关规定以便及时通知用户。
Loading

0 comments on commit 137bcba

Please sign in to comment.