Skip to content

Commit 3186a68

Browse files
committed
fix:all warn,add:stl container supported,change:FromString->FromJSON,rm:if constexpr
1 parent 8eed7fd commit 3186a68

12 files changed

+1623
-1238
lines changed

.clang-format

+157
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
BasedOnStyle: Google
2+
Language: Cpp
3+
AccessModifierOffset: -3
4+
AlignAfterOpenBracket: Align
5+
AlignConsecutiveMacros: AcrossComments
6+
AlignConsecutiveAssignments: AcrossComments
7+
AlignConsecutiveDeclarations: AcrossComments
8+
AlignEscapedNewlines: Right
9+
AlignOperands: true
10+
AlignTrailingComments: true
11+
AllowAllArgumentsOnNextLine: true
12+
AllowAllParametersOfDeclarationOnNextLine: true
13+
AllowShortBlocksOnASingleLine: Always
14+
AllowShortCaseLabelsOnASingleLine: true
15+
AllowShortFunctionsOnASingleLine: All
16+
AllowShortLambdasOnASingleLine: All
17+
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
18+
AllowShortLoopsOnASingleLine: true
19+
AlwaysBreakAfterReturnType: None
20+
AlwaysBreakBeforeMultilineStrings: false
21+
AlwaysBreakTemplateDeclarations: Yes
22+
BinPackArguments: true
23+
BinPackParameters: true
24+
BraceWrapping:
25+
AfterCaseLabel: false
26+
AfterClass: true
27+
AfterControlStatement: Always
28+
AfterEnum: false
29+
AfterFunction: true
30+
AfterNamespace: false
31+
AfterObjCDeclaration: false
32+
AfterStruct: true
33+
AfterUnion: true
34+
AfterExternBlock: true
35+
BeforeCatch: true
36+
BeforeElse: true
37+
38+
BreakBeforeBinaryOperators: None
39+
BreakBeforeBraces: Custom
40+
BreakBeforeInheritanceComma: false
41+
BreakInheritanceList: BeforeColon
42+
BreakBeforeTernaryOperators: true
43+
BreakConstructorInitializersBeforeComma: false
44+
BreakConstructorInitializers: BeforeColon
45+
BreakAfterJavaFieldAnnotations: false
46+
BreakStringLiterals: true
47+
ColumnLimit: 80
48+
CommentPragmas: "^ NOLINT:"
49+
CompactNamespaces: false
50+
ConstructorInitializerIndentWidth: 2
51+
ContinuationIndentWidth: 2
52+
Cpp11BracedListStyle: true
53+
DeriveLineEnding: true
54+
DerivePointerAlignment: true
55+
DisableFormat: false
56+
ExperimentalAutoDetectBinPacking: false
57+
FixNamespaceComments: true
58+
ForEachMacros:
59+
- foreach
60+
- Q_FOREACH
61+
- BOOST_FOREACH
62+
IncludeBlocks: Regroup
63+
IncludeCategories:
64+
- Regex: '^<ext/.*\.h>'
65+
Priority: 2
66+
SortPriority: 0
67+
- Regex: '^<.*\.h>'
68+
Priority: 1
69+
SortPriority: 0
70+
- Regex: "^<.*"
71+
Priority: 2
72+
SortPriority: 0
73+
- Regex: ".*"
74+
Priority: 3
75+
SortPriority: 0
76+
IncludeIsMainRegex: "([-_](test|unittest))?$"
77+
IncludeIsMainSourceRegex: ""
78+
IndentCaseLabels: true
79+
IndentGotoLabels: true
80+
IndentPPDirectives: None
81+
IndentWidth: 3
82+
IndentWrappedFunctionNames: false
83+
JavaScriptQuotes: Leave
84+
JavaScriptWrapImports: true
85+
KeepEmptyLinesAtTheStartOfBlocks: false
86+
MacroBlockBegin: ""
87+
MacroBlockEnd: ""
88+
MaxEmptyLinesToKeep: 1
89+
NamespaceIndentation: None
90+
ObjCBinPackProtocolList: Never
91+
ObjCBlockIndentWidth: 4
92+
ObjCSpaceAfterProperty: false
93+
ObjCSpaceBeforeProtocolList: true
94+
PenaltyBreakAssignment: 2
95+
PenaltyBreakBeforeFirstCallParameter: 1
96+
PenaltyBreakComment: 300
97+
PenaltyBreakFirstLessLess: 120
98+
PenaltyBreakString: 1000
99+
PenaltyBreakTemplateDeclaration: 10
100+
PenaltyExcessCharacter: 1000000
101+
PenaltyReturnTypeOnItsOwnLine: 200
102+
PointerAlignment: Right
103+
RawStringFormats:
104+
- Language: Cpp
105+
Delimiters:
106+
- cc
107+
- CC
108+
- cpp
109+
- Cpp
110+
- CPP
111+
- "c++"
112+
- "C++"
113+
CanonicalDelimiter: ""
114+
BasedOnStyle: google
115+
- Language: TextProto
116+
Delimiters:
117+
- pb
118+
- PB
119+
- proto
120+
- PROTO
121+
EnclosingFunctions:
122+
- EqualsProto
123+
- EquivToProto
124+
- PARSE_PARTIAL_TEXT_PROTO
125+
- PARSE_TEST_PROTO
126+
- PARSE_TEXT_PROTO
127+
- ParseTextOrDie
128+
- ParseTextProtoOrDie
129+
CanonicalDelimiter: ""
130+
BasedOnStyle: google
131+
ReflowComments: true
132+
SortIncludes: CaseInsensitive
133+
SortUsingDeclarations: false
134+
SpaceAfterCStyleCast: false
135+
SpaceAfterLogicalNot: false
136+
SpaceAfterTemplateKeyword: true
137+
SpaceBeforeAssignmentOperators: true
138+
SpaceBeforeCpp11BracedList: false
139+
SpaceBeforeCtorInitializerColon: true
140+
SpaceBeforeInheritanceColon: true
141+
SpaceBeforeParens: ControlStatements
142+
SpaceBeforeRangeBasedForLoopColon: true
143+
SpaceInEmptyBlock: false
144+
SpaceInEmptyParentheses: false
145+
SpacesBeforeTrailingComments: 3
146+
SpacesInAngles: false
147+
SpacesInConditionalStatement: false
148+
SpacesInContainerLiterals: false
149+
SpacesInCStyleCastParentheses: false
150+
SpacesInParentheses: false
151+
SpacesInSquareBrackets: false
152+
SpaceBeforeSquareBrackets: false
153+
Standard: Auto
154+
StatementMacros:
155+
- Q_UNUSED
156+
- QT_REQUIRE_VERSION
157+
TabWidth: 4

.gitignore

+1-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,2 @@
1-
cmake-build-debug
2-
cmake-build-release
3-
cmake-build-debug-mingw
4-
cmake-build-release-x64-msvc
5-
cmake-build-release-x86-msvc
6-
cmake-build-release-mingw
1+
cmake-build-*
72
.idea

CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
cmake_minimum_required(VERSION 3.14)
22
project(ejson)
33
# 检测C++版本,并给出提示
4+
#set(CMAKE_CXX_STANDARD 17)
5+
#set(CMAKE_CXX_STANDARD 14)
46
if(CMAKE_CXX_STANDARD LESS 11)
57
message(FATAL_ERROR "CMAKE_CXX_STANDARD must be at least 11")
68
elseif( CMAKE_CXX_STANDARD EQUAL 11)

0 commit comments

Comments
 (0)