Lines Matching full:io
38 enumeration(IO &IO, FormatStyle::BreakBeforeNoexceptSpecifierStyle &Value) {
39 IO.enumCase(Value, "Never", FormatStyle::BBNSS_Never);
40 IO.enumCase(Value, "OnlyWithParen", FormatStyle::BBNSS_OnlyWithParen);
41 IO.enumCase(Value, "Always", FormatStyle::BBNSS_Always);
46 static void enumInput(IO &IO, FormatStyle::AlignConsecutiveStyle &Value) {
47 IO.enumCase(Value, "None", FormatStyle::AlignConsecutiveStyle({}));
48 IO.enumCase(Value, "Consecutive",
54 IO.enumCase(Value, "AcrossEmptyLines",
60 IO.enumCase(Value, "AcrossComments",
66 IO.enumCase(Value, "AcrossEmptyLinesAndComments",
74 IO.enumCase(Value, "true",
80 IO.enumCase(Value, "false", FormatStyle::AlignConsecutiveStyle({}));
83 static void mapping(IO &IO, FormatStyle::AlignConsecutiveStyle &Value) {
84 IO.mapOptional("Enabled", Value.Enabled);
85 IO.mapOptional("AcrossEmptyLines", Value.AcrossEmptyLines);
86 IO.mapOptional("AcrossComments", Value.AcrossComments);
87 IO.mapOptional("AlignCompound", Value.AlignCompound);
88 IO.mapOptional("AlignFunctionDeclarations",
90 IO.mapOptional("AlignFunctionPointers", Value.AlignFunctionPointers);
91 IO.mapOptional("PadOperators", Value.PadOperators);
97 static void mapping(IO &IO,
99 IO.mapOptional("Enabled", Value.Enabled);
100 IO.mapOptional("AcrossEmptyLines", Value.AcrossEmptyLines);
101 IO.mapOptional("AcrossComments", Value.AcrossComments);
102 IO.mapOptional("AlignCaseArrows", Value.AlignCaseArrows);
103 IO.mapOptional("AlignCaseColons", Value.AlignCaseColons);
109 static void enumeration(IO &IO, FormatStyle::AttributeBreakingStyle &Value) {
110 IO.enumCase(Value, "Always", FormatStyle::ABS_Always);
111 IO.enumCase(Value, "Leave", FormatStyle::ABS_Leave);
112 IO.enumCase(Value, "Never", FormatStyle::ABS_Never);
118 static void enumeration(IO &IO,
120 IO.enumCase(Value, "None", FormatStyle::AIAS_None);
121 IO.enumCase(Value, "Left", FormatStyle::AIAS_Left);
122 IO.enumCase(Value, "Right", FormatStyle::AIAS_Right);
127 static void enumeration(IO &IO, FormatStyle::BinaryOperatorStyle &Value) {
128 IO.enumCase(Value, "All", FormatStyle::BOS_All);
129 IO.enumCase(Value, "true", FormatStyle::BOS_All);
130 IO.enumCase(Value, "None", FormatStyle::BOS_None);
131 IO.enumCase(Value, "false", FormatStyle::BOS_None);
132 IO.enumCase(Value, "NonAssignment", FormatStyle::BOS_NonAssignment);
138 static void enumeration(IO &IO, FormatStyle::BinPackParametersStyle &Value) {
139 IO.enumCase(Value, "BinPack", FormatStyle::BPPS_BinPack);
140 IO.enumCase(Value, "OnePerLine", FormatStyle::BPPS_OnePerLine);
141 IO.enumCase(Value, "AlwaysOnePerLine", FormatStyle::BPPS_AlwaysOnePerLine);
144 IO.enumCase(Value, "true", FormatStyle::BPPS_BinPack);
145 IO.enumCase(Value, "false", FormatStyle::BPPS_OnePerLine);
150 static void enumeration(IO &IO, FormatStyle::BinPackStyle &Value) {
151 IO.enumCase(Value, "Auto", FormatStyle::BPS_Auto);
152 IO.enumCase(Value, "Always", FormatStyle::BPS_Always);
153 IO.enumCase(Value, "Never", FormatStyle::BPS_Never);
159 static void enumeration(IO &IO,
161 IO.enumCase(Value, "Both", FormatStyle::BFCS_Both);
162 IO.enumCase(Value, "None", FormatStyle::BFCS_None);
163 IO.enumCase(Value, "Before", FormatStyle::BFCS_Before);
164 IO.enumCase(Value, "After", FormatStyle::BFCS_After);
169 static void enumeration(IO &IO, FormatStyle::BraceBreakingStyle &Value) {
170 IO.enumCase(Value, "Attach", FormatStyle::BS_Attach);
171 IO.enumCase(Value, "Linux", FormatStyle::BS_Linux);
172 IO.enumCase(Value, "Mozilla", FormatStyle::BS_Mozilla);
173 IO.enumCase(Value, "Stroustrup", FormatStyle::BS_Stroustrup);
174 IO.enumCase(Value, "Allman", FormatStyle::BS_Allman);
175 IO.enumCase(Value, "Whitesmiths", FormatStyle::BS_Whitesmiths);
176 IO.enumCase(Value, "GNU", FormatStyle::BS_GNU);
177 IO.enumCase(Value, "WebKit", FormatStyle::BS_WebKit);
178 IO.enumCase(Value, "Custom", FormatStyle::BS_Custom);
183 static void mapping(IO &IO, FormatStyle::BraceWrappingFlags &Wrapping) {
184 IO.mapOptional("AfterCaseLabel", Wrapping.AfterCaseLabel);
185 IO.mapOptional("AfterClass", Wrapping.AfterClass);
186 IO.mapOptional("AfterControlStatement", Wrapping.AfterControlStatement);
187 IO.mapOptional("AfterEnum", Wrapping.AfterEnum);
188 IO.mapOptional("AfterExternBlock", Wrapping.AfterExternBlock);
189 IO.mapOptional("AfterFunction", Wrapping.AfterFunction);
190 IO.mapOptional("AfterNamespace", Wrapping.AfterNamespace);
191 IO.mapOptional("AfterObjCDeclaration", Wrapping.AfterObjCDeclaration);
192 IO.mapOptional("AfterStruct", Wrapping.AfterStruct);
193 IO.mapOptional("AfterUnion", Wrapping.AfterUnion);
194 IO.mapOptional("BeforeCatch", Wrapping.BeforeCatch);
195 IO.mapOptional("BeforeElse", Wrapping.BeforeElse);
196 IO.mapOptional("BeforeLambdaBody", Wrapping.BeforeLambdaBody);
197 IO.mapOptional("BeforeWhile", Wrapping.BeforeWhile);
198 IO.mapOptional("IndentBraces", Wrapping.IndentBraces);
199 IO.mapOptional("SplitEmptyFunction", Wrapping.SplitEmptyFunction);
200 IO.mapOptional("SplitEmptyRecord", Wrapping.SplitEmptyRecord);
201 IO.mapOptional("SplitEmptyNamespace", Wrapping.SplitEmptyNamespace);
206 static void enumeration(IO &IO, FormatStyle::BracketAlignmentStyle &Value) {
207 IO.enumCase(Value, "Align", FormatStyle::BAS_Align);
208 IO.enumCase(Value, "DontAlign", FormatStyle::BAS_DontAlign);
209 IO.enumCase(Value, "AlwaysBreak", FormatStyle::BAS_AlwaysBreak);
210 IO.enumCase(Value, "BlockIndent", FormatStyle::BAS_BlockIndent);
213 IO.enumCase(Value, "true", FormatStyle::BAS_Align);
214 IO.enumCase(Value, "false", FormatStyle::BAS_DontAlign);
222 enumeration(IO &IO,
224 IO.enumCase(Value, "Never", FormatStyle::BWACS_Never);
225 IO.enumCase(Value, "MultiLine", FormatStyle::BWACS_MultiLine);
226 IO.enumCase(Value, "Always", FormatStyle::BWACS_Always);
229 IO.enumCase(Value, "false", FormatStyle::BWACS_Never);
230 IO.enumCase(Value, "true", FormatStyle::BWACS_Always);
238 enumeration(IO &IO, FormatStyle::BreakBeforeConceptDeclarationsStyle &Value) {
239 IO.enumCase(Value, "Never", FormatStyle::BBCDS_Never);
240 IO.enumCase(Value, "Allowed", FormatStyle::BBCDS_Allowed);
241 IO.enumCase(Value, "Always", FormatStyle::BBCDS_Always);
244 IO.enumCase(Value, "true", FormatStyle::BBCDS_Always);
245 IO.enumCase(Value, "false", FormatStyle::BBCDS_Allowed);
251 static void enumeration(IO &IO,
253 IO.enumCase(Value, "Never", FormatStyle::BBIAS_Never);
254 IO.enumCase(Value, "OnlyMultiline", FormatStyle::BBIAS_OnlyMultiline);
255 IO.enumCase(Value, "Always", FormatStyle::BBIAS_Always);
261 static void enumeration(IO &IO,
263 IO.enumCase(Value, "Never", FormatStyle::BBO_Never);
264 IO.enumCase(Value, "OnePerLine", FormatStyle::BBO_OnePerLine);
265 IO.enumCase(Value, "RespectPrecedence", FormatStyle::BBO_RespectPrecedence);
272 enumeration(IO &IO, FormatStyle::BreakConstructorInitializersStyle &Value) {
273 IO.enumCase(Value, "BeforeColon", FormatStyle::BCIS_BeforeColon);
274 IO.enumCase(Value, "BeforeComma", FormatStyle::BCIS_BeforeComma);
275 IO.enumCase(Value, "AfterColon", FormatStyle::BCIS_AfterColon);
281 static void enumeration(IO &IO,
283 IO.enumCase(Value, "BeforeColon", FormatStyle::BILS_BeforeColon);
284 IO.enumCase(Value, "BeforeComma", FormatStyle::BILS_BeforeComma);
285 IO.enumCase(Value, "AfterColon", FormatStyle::BILS_AfterColon);
286 IO.enumCase(Value, "AfterComma", FormatStyle::BILS_AfterComma);
292 static void enumeration(IO &IO,
294 IO.enumCase(Value, "Leave", FormatStyle::BTDS_Leave);
295 IO.enumCase(Value, "No", FormatStyle::BTDS_No);
296 IO.enumCase(Value, "MultiLine", FormatStyle::BTDS_MultiLine);
297 IO.enumCase(Value, "Yes", FormatStyle::BTDS_Yes);
300 IO.enumCase(Value, "false", FormatStyle::BTDS_MultiLine);
301 IO.enumCase(Value, "true", FormatStyle::BTDS_Yes);
306 static void enumeration(IO &IO, FormatStyle::DAGArgStyle &Value) {
307 IO.enumCase(Value, "DontBreak", FormatStyle::DAS_DontBreak);
308 IO.enumCase(Value, "BreakElements", FormatStyle::DAS_BreakElements);
309 IO.enumCase(Value, "BreakAll", FormatStyle::DAS_BreakAll);
316 enumeration(IO &IO, FormatStyle::DefinitionReturnTypeBreakingStyle &Value) {
317 IO.enumCase(Value, "None", FormatStyle::DRTBS_None);
318 IO.enumCase(Value, "All", FormatStyle::DRTBS_All);
319 IO.enumCase(Value, "TopLevel", FormatStyle::DRTBS_TopLevel);
322 IO.enumCase(Value, "false", FormatStyle::DRTBS_None);
323 IO.enumCase(Value, "true", FormatStyle::DRTBS_All);
329 static void enumeration(IO &IO,
331 IO.enumCase(Value, "DontAlign", FormatStyle::ENAS_DontAlign);
332 IO.enumCase(Value, "Left", FormatStyle::ENAS_Left);
333 IO.enumCase(Value, "LeftWithLastLine", FormatStyle::ENAS_LeftWithLastLine);
334 IO.enumCase(Value, "Right", FormatStyle::ENAS_Right);
337 IO.enumCase(Value, "true", FormatStyle::ENAS_Left);
338 IO.enumCase(Value, "false", FormatStyle::ENAS_Right);
345 enumeration(IO &IO, FormatStyle::EmptyLineAfterAccessModifierStyle &Value) {
346 IO.enumCase(Value, "Never", FormatStyle::ELAAMS_Never);
347 IO.enumCase(Value, "Leave", FormatStyle::ELAAMS_Leave);
348 IO.enumCase(Value, "Always", FormatStyle::ELAAMS_Always);
356 enumeration(IO &IO, FormatStyle::EmptyLineBeforeAccessModifierStyle &Value) {
357 IO.enumCase(Value, "Never", FormatStyle::ELBAMS_Never);
358 IO.enumCase(Value, "Leave", FormatStyle::ELBAMS_Leave);
359 IO.enumCase(Value, "LogicalBlock", FormatStyle::ELBAMS_LogicalBlock);
360 IO.enumCase(Value, "Always", FormatStyle::ELBAMS_Always);
366 static void enumeration(IO &IO, FormatStyle::IndentExternBlockStyle &Value) {
367 IO.enumCase(Value, "AfterExternBlock", FormatStyle::IEBS_AfterExternBlock);
368 IO.enumCase(Value, "Indent", FormatStyle::IEBS_Indent);
369 IO.enumCase(Value, "NoIndent", FormatStyle::IEBS_NoIndent);
370 IO.enumCase(Value, "true", FormatStyle::IEBS_Indent);
371 IO.enumCase(Value, "false", FormatStyle::IEBS_NoIndent);
376 static void mapping(IO &IO, FormatStyle::IntegerLiteralSeparatorStyle &Base) {
377 IO.mapOptional("Binary", Base.Binary);
378 IO.mapOptional("BinaryMinDigits", Base.BinaryMinDigits);
379 IO.mapOptional("Decimal", Base.Decimal);
380 IO.mapOptional("DecimalMinDigits", Base.DecimalMinDigits);
381 IO.mapOptional("Hex", Base.Hex);
382 IO.mapOptional("HexMinDigits", Base.HexMinDigits);
387 static void enumeration(IO &IO, FormatStyle::JavaScriptQuoteStyle &Value) {
388 IO.enumCase(Value, "Leave", FormatStyle::JSQS_Leave);
389 IO.enumCase(Value, "Single", FormatStyle::JSQS_Single);
390 IO.enumCase(Value, "Double", FormatStyle::JSQS_Double);
395 static void mapping(IO &IO, FormatStyle::KeepEmptyLinesStyle &Value) {
396 IO.mapOptional("AtEndOfFile", Value.AtEndOfFile);
397 IO.mapOptional("AtStartOfBlock", Value.AtStartOfBlock);
398 IO.mapOptional("AtStartOfFile", Value.AtStartOfFile);
403 static void enumeration(IO &IO, FormatStyle::LanguageKind &Value) {
404 IO.enumCase(Value, "Cpp", FormatStyle::LK_Cpp);
405 IO.enumCase(Value, "Java", FormatStyle::LK_Java);
406 IO.enumCase(Value, "JavaScript", FormatStyle::LK_JavaScript);
407 IO.enumCase(Value, "ObjC", FormatStyle::LK_ObjC);
408 IO.enumCase(Value, "Proto", FormatStyle::LK_Proto);
409 IO.enumCase(Value, "TableGen", FormatStyle::LK_TableGen);
410 IO.enumCase(Value, "TextProto", FormatStyle::LK_TextProto);
411 IO.enumCase(Value, "CSharp", FormatStyle::LK_CSharp);
412 IO.enumCase(Value, "Json", FormatStyle::LK_Json);
413 IO.enumCase(Value, "Verilog", FormatStyle::LK_Verilog);
418 static void enumeration(IO &IO, FormatStyle::LanguageStandard &Value) {
419 IO.enumCase(Value, "c++03", FormatStyle::LS_Cpp03);
420 IO.enumCase(Value, "C++03", FormatStyle::LS_Cpp03); // Legacy alias
421 IO.enumCase(Value, "Cpp03", FormatStyle::LS_Cpp03); // Legacy alias
423 IO.enumCase(Value, "c++11", FormatStyle::LS_Cpp11);
424 IO.enumCase(Value, "C++11", FormatStyle::LS_Cpp11); // Legacy alias
426 IO.enumCase(Value, "c++14", FormatStyle::LS_Cpp14);
427 IO.enumCase(Value, "c++17", FormatStyle::LS_Cpp17);
428 IO.enumCase(Value, "c++20", FormatStyle::LS_Cpp20);
430 IO.enumCase(Value, "Latest", FormatStyle::LS_Latest);
431 IO.enumCase(Value, "Cpp11", FormatStyle::LS_Latest); // Legacy alias
432 IO.enumCase(Value, "Auto", FormatStyle::LS_Auto);
438 static void enumeration(IO &IO,
440 IO.enumCase(Value, "Signature", FormatStyle::LBI_Signature);
441 IO.enumCase(Value, "OuterScope", FormatStyle::LBI_OuterScope);
446 static void enumeration(IO &IO, FormatStyle::LineEndingStyle &Value) {
447 IO.enumCase(Value, "LF", FormatStyle::LE_LF);
448 IO.enumCase(Value, "CRLF", FormatStyle::LE_CRLF);
449 IO.enumCase(Value, "DeriveLF", FormatStyle::LE_DeriveLF);
450 IO.enumCase(Value, "DeriveCRLF", FormatStyle::LE_DeriveCRLF);
456 static void enumeration(IO &IO,
458 IO.enumCase(Value, "None", FormatStyle::NI_None);
459 IO.enumCase(Value, "Inner", FormatStyle::NI_Inner);
460 IO.enumCase(Value, "All", FormatStyle::NI_All);
465 static void enumeration(IO &IO, FormatStyle::OperandAlignmentStyle &Value) {
466 IO.enumCase(Value, "DontAlign", FormatStyle::OAS_DontAlign);
467 IO.enumCase(Value, "Align", FormatStyle::OAS_Align);
468 IO.enumCase(Value, "AlignAfterOperator",
472 IO.enumCase(Value, "true", FormatStyle::OAS_Align);
473 IO.enumCase(Value, "false", FormatStyle::OAS_DontAlign);
480 enumeration(IO &IO, FormatStyle::PackConstructorInitializersStyle &Value) {
481 IO.enumCase(Value, "Never", FormatStyle::PCIS_Never);
482 IO.enumCase(Value, "BinPack", FormatStyle::PCIS_BinPack);
483 IO.enumCase(Value, "CurrentLine", FormatStyle::PCIS_CurrentLine);
484 IO.enumCase(Value, "NextLine", FormatStyle::PCIS_NextLine);
485 IO.enumCase(Value, "NextLineOnly", FormatStyle::PCIS_NextLineOnly);
490 static void enumeration(IO &IO, FormatStyle::PointerAlignmentStyle &Value) {
491 IO.enumCase(Value, "Middle", FormatStyle::PAS_Middle);
492 IO.enumCase(Value, "Left", FormatStyle::PAS_Left);
493 IO.enumCase(Value, "Right", FormatStyle::PAS_Right);
496 IO.enumCase(Value, "true", FormatStyle::PAS_Left);
497 IO.enumCase(Value, "false", FormatStyle::PAS_Right);
503 static void enumeration(IO &IO, FormatStyle::PPDirectiveIndentStyle &Value) {
504 IO.enumCase(Value, "None", FormatStyle::PPDIS_None);
505 IO.enumCase(Value, "AfterHash", FormatStyle::PPDIS_AfterHash);
506 IO.enumCase(Value, "BeforeHash", FormatStyle::PPDIS_BeforeHash);
512 static void enumeration(IO &IO, FormatStyle::QualifierAlignmentStyle &Value) {
513 IO.enumCase(Value, "Leave", FormatStyle::QAS_Leave);
514 IO.enumCase(Value, "Left", FormatStyle::QAS_Left);
515 IO.enumCase(Value, "Right", FormatStyle::QAS_Right);
516 IO.enumCase(Value, "Custom", FormatStyle::QAS_Custom);
521 static void mapping(IO &IO, FormatStyle::RawStringFormat &Format) {
522 IO.mapOptional("Language", Format.Language);
523 IO.mapOptional("Delimiters", Format.Delimiters);
524 IO.mapOptional("EnclosingFunctions", Format.EnclosingFunctions);
525 IO.mapOptional("CanonicalDelimiter", Format.CanonicalDelimiter);
526 IO.mapOptional("BasedOnStyle", Format.BasedOnStyle);
531 static void enumeration(IO &IO, FormatStyle::ReflowCommentsStyle &Value) {
532 IO.enumCase(Value, "Never", FormatStyle::RCS_Never);
533 IO.enumCase(Value, "IndentOnly", FormatStyle::RCS_IndentOnly);
534 IO.enumCase(Value, "Always", FormatStyle::RCS_Always);
536 IO.enumCase(Value, "false", FormatStyle::RCS_Never);
537 IO.enumCase(Value, "true", FormatStyle::RCS_Always);
543 static void enumeration(IO &IO, FormatStyle::ReferenceAlignmentStyle &Value) {
544 IO.enumCase(Value, "Pointer", FormatStyle::RAS_Pointer);
545 IO.enumCase(Value, "Middle", FormatStyle::RAS_Middle);
546 IO.enumCase(Value, "Left", FormatStyle::RAS_Left);
547 IO.enumCase(Value, "Right", FormatStyle::RAS_Right);
553 static void enumeration(IO &IO, FormatStyle::RemoveParenthesesStyle &Value) {
554 IO.enumCase(Value, "Leave", FormatStyle::RPS_Leave);
555 IO.enumCase(Value, "MultipleParentheses",
557 IO.enumCase(Value, "ReturnStatement", FormatStyle::RPS_ReturnStatement);
563 static void enumeration(IO &IO,
565 IO.enumCase(Value, "OwnLine", FormatStyle::RCPS_OwnLine);
566 IO.enumCase(Value, "OwnLineWithBrace", FormatStyle::RCPS_OwnLineWithBrace);
567 IO.enumCase(Value, "WithPreceding", FormatStyle::RCPS_WithPreceding);
568 IO.enumCase(Value, "WithFollowing", FormatStyle::RCPS_WithFollowing);
569 IO.enumCase(Value, "SingleLine", FormatStyle::RCPS_SingleLine);
576 enumeration(IO &IO, FormatStyle::RequiresExpressionIndentationKind &Value) {
577 IO.enumCase(Value, "Keyword", FormatStyle::REI_Keyword);
578 IO.enumCase(Value, "OuterScope", FormatStyle::REI_OuterScope);
584 static void enumeration(IO &IO, FormatStyle::ReturnTypeBreakingStyle &Value) {
585 IO.enumCase(Value, "None", FormatStyle::RTBS_None);
586 IO.enumCase(Value, "Automatic", FormatStyle::RTBS_Automatic);
587 IO.enumCase(Value, "ExceptShortType", FormatStyle::RTBS_ExceptShortType);
588 IO.enumCase(Value, "All", FormatStyle::RTBS_All);
589 IO.enumCase(Value, "TopLevel", FormatStyle::RTBS_TopLevel);
590 IO.enumCase(Value, "TopLevelDefinitions",
592 IO.enumCase(Value, "AllDefinitions", FormatStyle::RTBS_AllDefinitions);
598 static void enumeration(IO &IO, FormatStyle::SeparateDefinitionStyle &Value) {
599 IO.enumCase(Value, "Leave", FormatStyle::SDS_Leave);
600 IO.enumCase(Value, "Always", FormatStyle::SDS_Always);
601 IO.enumCase(Value, "Never", FormatStyle::SDS_Never);
606 static void enumeration(IO &IO, FormatStyle::ShortBlockStyle &Value) {
607 IO.enumCase(Value, "Never", FormatStyle::SBS_Never);
608 IO.enumCase(Value, "false", FormatStyle::SBS_Never);
609 IO.enumCase(Value, "Always", FormatStyle::SBS_Always);
610 IO.enumCase(Value, "true", FormatStyle::SBS_Always);
611 IO.enumCase(Value, "Empty", FormatStyle::SBS_Empty);
616 static void enumeration(IO &IO, FormatStyle::ShortFunctionStyle &Value) {
617 IO.enumCase(Value, "None", FormatStyle::SFS_None);
618 IO.enumCase(Value, "false", FormatStyle::SFS_None);
619 IO.enumCase(Value, "All", FormatStyle::SFS_All);
620 IO.enumCase(Value, "true", FormatStyle::SFS_All);
621 IO.enumCase(Value, "Inline", FormatStyle::SFS_Inline);
622 IO.enumCase(Value, "InlineOnly", FormatStyle::SFS_InlineOnly);
623 IO.enumCase(Value, "Empty", FormatStyle::SFS_Empty);
628 static void enumeration(IO &IO, FormatStyle::ShortIfStyle &Value) {
629 IO.enumCase(Value, "Never", FormatStyle::SIS_Never);
630 IO.enumCase(Value, "WithoutElse", FormatStyle::SIS_WithoutElse);
631 IO.enumCase(Value, "OnlyFirstIf", FormatStyle::SIS_OnlyFirstIf);
632 IO.enumCase(Value, "AllIfsAndElse", FormatStyle::SIS_AllIfsAndElse);
635 IO.enumCase(Value, "Always", FormatStyle::SIS_OnlyFirstIf);
636 IO.enumCase(Value, "false", FormatStyle::SIS_Never);
637 IO.enumCase(Value, "true", FormatStyle::SIS_WithoutElse);
642 static void enumeration(IO &IO, FormatStyle::ShortLambdaStyle &Value) {
643 IO.enumCase(Value, "None", FormatStyle::SLS_None);
644 IO.enumCase(Value, "false", FormatStyle::SLS_None);
645 IO.enumCase(Value, "Empty", FormatStyle::SLS_Empty);
646 IO.enumCase(Value, "Inline", FormatStyle::SLS_Inline);
647 IO.enumCase(Value, "All", FormatStyle::SLS_All);
648 IO.enumCase(Value, "true", FormatStyle::SLS_All);
653 static void enumeration(IO &IO, FormatStyle::SortIncludesOptions &Value) {
654 IO.enumCase(Value, "Never", FormatStyle::SI_Never);
655 IO.enumCase(Value, "CaseInsensitive", FormatStyle::SI_CaseInsensitive);
656 IO.enumCase(Value, "CaseSensitive", FormatStyle::SI_CaseSensitive);
659 IO.enumCase(Value, "false", FormatStyle::SI_Never);
660 IO.enumCase(Value, "true", FormatStyle::SI_CaseSensitive);
666 static void enumeration(IO &IO,
668 IO.enumCase(Value, "Before", FormatStyle::SJSIO_Before);
669 IO.enumCase(Value, "After", FormatStyle::SJSIO_After);
675 static void enumeration(IO &IO,
677 IO.enumCase(Value, "Never", FormatStyle::SUD_Never);
678 IO.enumCase(Value, "Lexicographic", FormatStyle::SUD_Lexicographic);
679 IO.enumCase(Value, "LexicographicNumeric",
683 IO.enumCase(Value, "false", FormatStyle::SUD_Never);
684 IO.enumCase(Value, "true", FormatStyle::SUD_LexicographicNumeric);
691 enumeration(IO &IO, FormatStyle::SpaceAroundPointerQualifiersStyle &Value) {
692 IO.enumCase(Value, "Default", FormatStyle::SAPQ_Default);
693 IO.enumCase(Value, "Before", FormatStyle::SAPQ_Before);
694 IO.enumCase(Value, "After", FormatStyle::SAPQ_After);
695 IO.enumCase(Value, "Both", FormatStyle::SAPQ_Both);
700 static void mapping(IO &IO, FormatStyle::SpaceBeforeParensCustom &Spacing) {
701 IO.mapOptional("AfterControlStatements", Spacing.AfterControlStatements);
702 IO.mapOptional("AfterForeachMacros", Spacing.AfterForeachMacros);
703 IO.mapOptional("AfterFunctionDefinitionName",
705 IO.mapOptional("AfterFunctionDeclarationName",
707 IO.mapOptional("AfterIfMacros", Spacing.AfterIfMacros);
708 IO.mapOptional("AfterOverloadedOperator", Spacing.AfterOverloadedOperator);
709 IO.mapOptional("AfterPlacementOperator", Spacing.AfterPlacementOperator);
710 IO.mapOptional("AfterRequiresInClause", Spacing.AfterRequiresInClause);
711 IO.mapOptional("AfterRequiresInExpression",
713 IO.mapOptional("BeforeNonEmptyParentheses",
720 static void enumeration(IO &IO, FormatStyle::SpaceBeforeParensStyle &Value) {
721 IO.enumCase(Value, "Never", FormatStyle::SBPO_Never);
722 IO.enumCase(Value, "ControlStatements",
724 IO.enumCase(Value, "ControlStatementsExceptControlMacros",
726 IO.enumCase(Value, "NonEmptyParentheses",
728 IO.enumCase(Value, "Always", FormatStyle::SBPO_Always);
729 IO.enumCase(Value, "Custom", FormatStyle::SBPO_Custom);
732 IO.enumCase(Value, "false", FormatStyle::SBPO_Never);
733 IO.enumCase(Value, "true", FormatStyle::SBPO_ControlStatements);
734 IO.enumCase(Value, "ControlStatementsExceptForEachMacros",
740 static void enumeration(IO &IO, FormatStyle::SpacesInAnglesStyle &Value) {
741 IO.enumCase(Value, "Never", FormatStyle::SIAS_Never);
742 IO.enumCase(Value, "Always", FormatStyle::SIAS_Always);
743 IO.enumCase(Value, "Leave", FormatStyle::SIAS_Leave);
746 IO.enumCase(Value, "false", FormatStyle::SIAS_Never);
747 IO.enumCase(Value, "true", FormatStyle::SIAS_Always);
752 static void mapping(IO &IO, FormatStyle::SpacesInLineComment &Space) {
755 IO.mapOptional("Minimum", Space.Minimum);
756 IO.mapOptional("Maximum", signedMaximum);
765 static void mapping(IO &IO, FormatStyle::SpacesInParensCustom &Spaces) {
766 IO.mapOptional("ExceptDoubleParentheses", Spaces.ExceptDoubleParentheses);
767 IO.mapOptional("InCStyleCasts", Spaces.InCStyleCasts);
768 IO.mapOptional("InConditionalStatements", Spaces.InConditionalStatements);
769 IO.mapOptional("InEmptyParentheses", Spaces.InEmptyParentheses);
770 IO.mapOptional("Other", Spaces.Other);
775 static void enumeration(IO &IO, FormatStyle::SpacesInParensStyle &Value) {
776 IO.enumCase(Value, "Never", FormatStyle::SIPO_Never);
777 IO.enumCase(Value, "Custom", FormatStyle::SIPO_Custom);
782 static void enumeration(IO &IO, FormatStyle::TrailingCommaStyle &Value) {
783 IO.enumCase(Value, "None", FormatStyle::TCS_None);
784 IO.enumCase(Value, "Wrapped", FormatStyle::TCS_Wrapped);
790 static void enumeration(IO &IO,
792 IO.enumCase(Value, "Leave", FormatStyle::TCAS_Leave);
793 IO.enumCase(Value, "Always", FormatStyle::TCAS_Always);
794 IO.enumCase(Value, "Never", FormatStyle::TCAS_Never);
799 static void enumInput(IO &IO,
801 IO.enumCase(Value, "Leave",
805 IO.enumCase(Value, "Always",
809 IO.enumCase(Value, "Never",
814 IO.enumCase(Value, "true",
817 IO.enumCase(Value, "false",
822 static void mapping(IO &IO,
824 IO.mapOptional("Kind", Value.Kind);
825 IO.mapOptional("OverEmptyLines", Value.OverEmptyLines);
830 static void enumeration(IO &IO, FormatStyle::UseTabStyle &Value) {
831 IO.enumCase(Value, "Never", FormatStyle::UT_Never);
832 IO.enumCase(Value, "false", FormatStyle::UT_Never);
833 IO.enumCase(Value, "Always", FormatStyle::UT_Always);
834 IO.enumCase(Value, "true", FormatStyle::UT_Always);
835 IO.enumCase(Value, "ForIndentation", FormatStyle::UT_ForIndentation);
836 IO.enumCase(Value, "ForContinuationAndIndentation",
838 IO.enumCase(Value, "AlignWithSpaces", FormatStyle::UT_AlignWithSpaces);
846 enumeration(IO &IO,
848 IO.enumCase(Value, "Never", FormatStyle::WNBWELS_Never);
849 IO.enumCase(Value, "Always", FormatStyle::WNBWELS_Always);
850 IO.enumCase(Value, "Leave", FormatStyle::WNBWELS_Leave);
855 static void mapping(IO &IO, FormatStyle &Style) {
857 IO.mapOptional("Language", Style.Language);
860 if (IO.outputting()) {
872 IO.mapOptional("BasedOnStyle", BasedOnStyle);
876 ((FormatStyle *)IO.getContext())->Language;
878 IO.setError(Twine("Unknown value for BasedOnStyle: ", BasedOnStyle));
913 if (!IO.outputting()) {
914 IO.mapOptional("AlignEscapedNewlinesLeft", Style.AlignEscapedNewlines);
915 IO.mapOptional("AllowAllConstructorInitializersOnNextLine", OnNextLine);
916 IO.mapOptional("AlwaysBreakAfterReturnType", Style.BreakAfterReturnType);
917 IO.mapOptional("AlwaysBreakTemplateDeclarations",
919 IO.mapOptional("BreakBeforeInheritanceComma",
921 IO.mapOptional("BreakConstructorInitializersBeforeComma",
923 IO.mapOptional("ConstructorInitializerAllOnOneLineOrOnePerLine",
925 IO.mapOptional("DeriveLineEnding", DeriveLineEnding);
926 IO.mapOptional("DerivePointerBinding", Style.DerivePointerAlignment);
927 IO.mapOptional("KeepEmptyLinesAtEOF", Style.KeepEmptyLines.AtEndOfFile);
928 IO.mapOptional("KeepEmptyLinesAtTheStartOfBlocks",
930 IO.mapOptional("IndentFunctionDeclarationAfterType",
932 IO.mapOptional("IndentRequires", Style.IndentRequiresClause);
933 IO.mapOptional("PointerBindsToType", Style.PointerAlignment);
934 IO.mapOptional("SpaceAfterControlStatementKeyword",
936 IO.mapOptional("SpaceInEmptyParentheses", SpaceInEmptyParentheses);
937 IO.mapOptional("SpacesInConditionalStatement",
939 IO.mapOptional("SpacesInCStyleCastParentheses",
941 IO.mapOptional("SpacesInParentheses", SpacesInParentheses);
942 IO.mapOptional("UseCRLF", UseCRLF);
945 IO.mapOptional("AccessModifierOffset", Style.AccessModifierOffset);
946 IO.mapOptional("AlignAfterOpenBracket", Style.AlignAfterOpenBracket);
947 IO.mapOptional("AlignArrayOfStructures", Style.AlignArrayOfStructures);
948 IO.mapOptional("AlignConsecutiveAssignments",
950 IO.mapOptional("AlignConsecutiveBitFields",
952 IO.mapOptional("AlignConsecutiveDeclarations",
954 IO.mapOptional("AlignConsecutiveMacros", Style.AlignConsecutiveMacros);
955 IO.mapOptional("AlignConsecutiveShortCaseStatements",
957 IO.mapOptional("AlignConsecutiveTableGenBreakingDAGArgColons",
959 IO.mapOptional("AlignConsecutiveTableGenCondOperatorColons",
961 IO.mapOptional("AlignConsecutiveTableGenDefinitionColons",
963 IO.mapOptional("AlignEscapedNewlines", Style.AlignEscapedNewlines);
964 IO.mapOptional("AlignOperands", Style.AlignOperands);
965 IO.mapOptional("AlignTrailingComments", Style.AlignTrailingComments);
966 IO.mapOptional("AllowAllArgumentsOnNextLine",
968 IO.mapOptional("AllowAllParametersOfDeclarationOnNextLine",
970 IO.mapOptional("AllowBreakBeforeNoexceptSpecifier",
972 IO.mapOptional("AllowShortBlocksOnASingleLine",
974 IO.mapOptional("AllowShortCaseExpressionOnASingleLine",
976 IO.mapOptional("AllowShortCaseLabelsOnASingleLine",
978 IO.mapOptional("AllowShortCompoundRequirementOnASingleLine",
980 IO.mapOptional("AllowShortEnumsOnASingleLine",
982 IO.mapOptional("AllowShortFunctionsOnASingleLine",
984 IO.mapOptional("AllowShortIfStatementsOnASingleLine",
986 IO.mapOptional("AllowShortLambdasOnASingleLine",
988 IO.mapOptional("AllowShortLoopsOnASingleLine",
990 IO.mapOptional("AllowShortNamespacesOnASingleLine",
992 IO.mapOptional("AlwaysBreakAfterDefinitionReturnType",
994 IO.mapOptional("AlwaysBreakBeforeMultilineStrings",
996 IO.mapOptional("AttributeMacros", Style.AttributeMacros);
997 IO.mapOptional("BinPackArguments", Style.BinPackArguments);
998 IO.mapOptional("BinPackParameters", Style.BinPackParameters);
999 IO.mapOptional("BitFieldColonSpacing", Style.BitFieldColonSpacing);
1000 IO.mapOptional("BracedInitializerIndentWidth",
1002 IO.mapOptional("BraceWrapping", Style.BraceWrapping);
1003 IO.mapOptional("BreakAdjacentStringLiterals",
1005 IO.mapOptional("BreakAfterAttributes", Style.BreakAfterAttributes);
1006 IO.mapOptional("BreakAfterJavaFieldAnnotations",
1008 IO.mapOptional("BreakAfterReturnType", Style.BreakAfterReturnType);
1009 IO.mapOptional("BreakArrays", Style.BreakArrays);
1010 IO.mapOptional("BreakBeforeBinaryOperators",
1012 IO.mapOptional("BreakBeforeConceptDeclarations",
1014 IO.mapOptional("BreakBeforeBraces", Style.BreakBeforeBraces);
1015 IO.mapOptional("BreakBeforeInlineASMColon",
1017 IO.mapOptional("BreakBeforeTernaryOperators",
1019 IO.mapOptional("BreakBinaryOperations", Style.BreakBinaryOperations);
1020 IO.mapOptional("BreakConstructorInitializers",
1022 IO.mapOptional("BreakFunctionDefinitionParameters",
1024 IO.mapOptional("BreakInheritanceList", Style.BreakInheritanceList);
1025 IO.mapOptional("BreakStringLiterals", Style.BreakStringLiterals);
1026 IO.mapOptional("BreakTemplateDeclarations",
1028 IO.mapOptional("ColumnLimit", Style.ColumnLimit);
1029 IO.mapOptional("CommentPragmas", Style.CommentPragmas);
1030 IO.mapOptional("CompactNamespaces", Style.CompactNamespaces);
1031 IO.mapOptional("ConstructorInitializerIndentWidth",
1033 IO.mapOptional("ContinuationIndentWidth", Style.ContinuationIndentWidth);
1034 IO.mapOptional("Cpp11BracedListStyle", Style.Cpp11BracedListStyle);
1035 IO.mapOptional("DerivePointerAlignment", Style.DerivePointerAlignment);
1036 IO.mapOptional("DisableFormat", Style.DisableFormat);
1037 IO.mapOptional("EmptyLineAfterAccessModifier",
1039 IO.mapOptional("EmptyLineBeforeAccessModifier",
1041 IO.mapOptional("ExperimentalAutoDetectBinPacking",
1043 IO.mapOptional("FixNamespaceComments", Style.FixNamespaceComments);
1044 IO.mapOptional("ForEachMacros", Style.ForEachMacros);
1045 IO.mapOptional("IfMacros", Style.IfMacros);
1046 IO.mapOptional("IncludeBlocks", Style.IncludeStyle.IncludeBlocks);
1047 IO.mapOptional("IncludeCategories", Style.IncludeStyle.IncludeCategories);
1048 IO.mapOptional("IncludeIsMainRegex", Style.IncludeStyle.IncludeIsMainRegex);
1049 IO.mapOptional("IncludeIsMainSourceRegex",
1051 IO.mapOptional("IndentAccessModifiers", Style.IndentAccessModifiers);
1052 IO.mapOptional("IndentCaseBlocks", Style.IndentCaseBlocks);
1053 IO.mapOptional("IndentCaseLabels", Style.IndentCaseLabels);
1054 IO.mapOptional("IndentExportBlock", Style.IndentExportBlock);
1055 IO.mapOptional("IndentExternBlock", Style.IndentExternBlock);
1056 IO.mapOptional("IndentGotoLabels", Style.IndentGotoLabels);
1057 IO.mapOptional("IndentPPDirectives", Style.IndentPPDirectives);
1058 IO.mapOptional("IndentRequiresClause", Style.IndentRequiresClause);
1059 IO.mapOptional("IndentWidth", Style.IndentWidth);
1060 IO.mapOptional("IndentWrappedFunctionNames",
1062 IO.mapOptional("InsertBraces", Style.InsertBraces);
1063 IO.mapOptional("InsertNewlineAtEOF", Style.InsertNewlineAtEOF);
1064 IO.mapOptional("InsertTrailingCommas", Style.InsertTrailingCommas);
1065 IO.mapOptional("IntegerLiteralSeparator", Style.IntegerLiteralSeparator);
1066 IO.mapOptional("JavaImportGroups", Style.JavaImportGroups);
1067 IO.mapOptional("JavaScriptQuotes", Style.JavaScriptQuotes);
1068 IO.mapOptional("JavaScriptWrapImports", Style.JavaScriptWrapImports);
1069 IO.mapOptional("KeepEmptyLines", Style.KeepEmptyLines);
1070 IO.mapOptional("KeepFormFeed", Style.KeepFormFeed);
1071 IO.mapOptional("LambdaBodyIndentation", Style.LambdaBodyIndentation);
1072 IO.mapOptional("LineEnding", Style.LineEnding);
1073 IO.mapOptional("MacroBlockBegin", Style.MacroBlockBegin);
1074 IO.mapOptional("MacroBlockEnd", Style.MacroBlockEnd);
1075 IO.mapOptional("Macros", Style.Macros);
1076 IO.mapOptional("MainIncludeChar", Style.IncludeStyle.MainIncludeChar);
1077 IO.mapOptional("MaxEmptyLinesToKeep", Style.MaxEmptyLinesToKeep);
1078 IO.mapOptional("NamespaceIndentation", Style.NamespaceIndentation);
1079 IO.mapOptional("NamespaceMacros", Style.NamespaceMacros);
1080 IO.mapOptional("ObjCBinPackProtocolList", Style.ObjCBinPackProtocolList);
1081 IO.mapOptional("ObjCBlockIndentWidth", Style.ObjCBlockIndentWidth);
1082 IO.mapOptional("ObjCBreakBeforeNestedBlockParam",
1084 IO.mapOptional("ObjCPropertyAttributeOrder",
1086 IO.mapOptional("ObjCSpaceAfterProperty", Style.ObjCSpaceAfterProperty);
1087 IO.mapOptional("ObjCSpaceBeforeProtocolList",
1089 IO.mapOptional("PackConstructorInitializers",
1091 IO.mapOptional("PenaltyBreakAssignment", Style.PenaltyBreakAssignment);
1092 IO.mapOptional("PenaltyBreakBeforeFirstCallParameter",
1094 IO.mapOptional("PenaltyBreakBeforeMemberAccess",
1096 IO.mapOptional("PenaltyBreakComment", Style.PenaltyBreakComment);
1097 IO.mapOptional("PenaltyBreakFirstLessLess",
1099 IO.mapOptional("PenaltyBreakOpenParenthesis",
1101 IO.mapOptional("PenaltyBreakScopeResolution",
1103 IO.mapOptional("PenaltyBreakString", Style.PenaltyBreakString);
1104 IO.mapOptional("PenaltyBreakTemplateDeclaration",
1106 IO.mapOptional("PenaltyExcessCharacter", Style.PenaltyExcessCharacter);
1107 IO.mapOptional("PenaltyIndentedWhitespace",
1109 IO.mapOptional("PenaltyReturnTypeOnItsOwnLine",
1111 IO.mapOptional("PointerAlignment", Style.PointerAlignment);
1112 IO.mapOptional("PPIndentWidth", Style.PPIndentWidth);
1113 IO.mapOptional("QualifierAlignment", Style.QualifierAlignment);
1120 IO.mapOptional("QualifierOrder", Style.QualifierOrder);
1121 IO.mapOptional("RawStringFormats", Style.RawStringFormats);
1122 IO.mapOptional("ReferenceAlignment", Style.ReferenceAlignment);
1123 IO.mapOptional("ReflowComments", Style.ReflowComments);
1124 IO.mapOptional("RemoveBracesLLVM", Style.RemoveBracesLLVM);
1125 IO.mapOptional("RemoveEmptyLinesInUnwrappedLines",
1127 IO.mapOptional("RemoveParentheses", Style.RemoveParentheses);
1128 IO.mapOptional("RemoveSemicolon", Style.RemoveSemicolon);
1129 IO.mapOptional("RequiresClausePosition", Style.RequiresClausePosition);
1130 IO.mapOptional("RequiresExpressionIndentation",
1132 IO.mapOptional("SeparateDefinitionBlocks", Style.SeparateDefinitionBlocks);
1133 IO.mapOptional("ShortNamespaceLines", Style.ShortNamespaceLines);
1134 IO.mapOptional("SkipMacroDefinitionBody", Style.SkipMacroDefinitionBody);
1135 IO.mapOptional("SortIncludes", Style.SortIncludes);
1136 IO.mapOptional("SortJavaStaticImport", Style.SortJavaStaticImport);
1137 IO.mapOptional("SortUsingDeclarations", Style.SortUsingDeclarations);
1138 IO.mapOptional("SpaceAfterCStyleCast", Style.SpaceAfterCStyleCast);
1139 IO.mapOptional("SpaceAfterLogicalNot", Style.SpaceAfterLogicalNot);
1140 IO.mapOptional("SpaceAfterTemplateKeyword",
1142 IO.mapOptional("SpaceAroundPointerQualifiers",
1144 IO.mapOptional("SpaceBeforeAssignmentOperators",
1146 IO.mapOptional("SpaceBeforeCaseColon", Style.SpaceBeforeCaseColon);
1147 IO.mapOptional("SpaceBeforeCpp11BracedList",
1149 IO.mapOptional("SpaceBeforeCtorInitializerColon",
1151 IO.mapOptional("SpaceBeforeInheritanceColon",
1153 IO.mapOptional("SpaceBeforeJsonColon", Style.SpaceBeforeJsonColon);
1154 IO.mapOptional("SpaceBeforeParens", Style.SpaceBeforeParens);
1155 IO.mapOptional("SpaceBeforeParensOptions", Style.SpaceBeforeParensOptions);
1156 IO.mapOptional("SpaceBeforeRangeBasedForLoopColon",
1158 IO.mapOptional("SpaceBeforeSquareBrackets",
1160 IO.mapOptional("SpaceInEmptyBlock", Style.SpaceInEmptyBlock);
1161 IO.mapOptional("SpacesBeforeTrailingComments",
1163 IO.mapOptional("SpacesInAngles", Style.SpacesInAngles);
1164 IO.mapOptional("SpacesInContainerLiterals",
1166 IO.mapOptional("SpacesInLineCommentPrefix",
1168 IO.mapOptional("SpacesInParens", Style.SpacesInParens);
1169 IO.mapOptional("SpacesInParensOptions", Style.SpacesInParensOptions);
1170 IO.mapOptional("SpacesInSquareBrackets", Style.SpacesInSquareBrackets);
1171 IO.mapOptional("Standard", Style.Standard);
1172 IO.mapOptional("StatementAttributeLikeMacros",
1174 IO.mapOptional("StatementMacros", Style.StatementMacros);
1175 IO.mapOptional("TableGenBreakingDAGArgOperators",
1177 IO.mapOptional("TableGenBreakInsideDAGArg",
1179 IO.mapOptional("TabWidth", Style.TabWidth);
1180 IO.mapOptional("TemplateNames", Style.TemplateNames);
1181 IO.mapOptional("TypeNames", Style.TypeNames);
1182 IO.mapOptional("TypenameMacros", Style.TypenameMacros);
1183 IO.mapOptional("UseTab", Style.UseTab);
1184 IO.mapOptional("VariableTemplates", Style.VariableTemplates);
1185 IO.mapOptional("VerilogBreakBetweenInstancePorts",
1187 IO.mapOptional("WhitespaceSensitiveMacros",
1189 IO.mapOptional("WrapNamespaceBodyWithEmptyLines",
1270 // IO.getContext() should contain a pointer to the FormatStyle structure, that
1275 static size_t size(IO &IO, std::vector<FormatStyle> &Seq) {
1278 static FormatStyle &element(IO &IO, std::vector<FormatStyle> &Seq,
1286 Template = *((const FormatStyle *)IO.getContext());
1799 // https://google.github.io/styleguide/jsguide.html#features-arrays-trailing-comma