updated filestructure and gitignore. uploading exam progress
This commit is contained in:
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,7 +1,2 @@
|
||||
# Ignore all
|
||||
*
|
||||
|
||||
# But keep these files
|
||||
!*.cpp
|
||||
!*.h
|
||||
!*CMakeLists.txt
|
||||
# Ignore
|
||||
*.zip
|
||||
|
||||
5
Exam/IKT203Exam/.gitignore
vendored
Normal file
5
Exam/IKT203Exam/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
# Ignore Visual Studio cache
|
||||
.vs/
|
||||
|
||||
# Ignore build/output directory
|
||||
out/
|
||||
8
Exam/IKT203Exam/.idea/.gitignore
generated
vendored
Normal file
8
Exam/IKT203Exam/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
1
Exam/IKT203Exam/.idea/.name
generated
Normal file
1
Exam/IKT203Exam/.idea/.name
generated
Normal file
@@ -0,0 +1 @@
|
||||
IKT203_Course_Assignments
|
||||
2
Exam/IKT203Exam/.idea/IKT203-main.iml
generated
Normal file
2
Exam/IKT203Exam/.idea/IKT203-main.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
343
Exam/IKT203Exam/.idea/editor.xml
generated
Normal file
343
Exam/IKT203Exam/.idea/editor.xml
generated
Normal file
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
</component>
|
||||
</project>
|
||||
10
Exam/IKT203Exam/.idea/material_theme_project_new.xml
generated
Normal file
10
Exam/IKT203Exam/.idea/material_theme_project_new.xml
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="MaterialThemeProjectNewConfig">
|
||||
<option name="metadata">
|
||||
<MTProjectMetadataState>
|
||||
<option name="userId" value="54f3be3a:19a5567208e:-7fff" />
|
||||
</MTProjectMetadataState>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
||||
7
Exam/IKT203Exam/.idea/misc.xml
generated
Normal file
7
Exam/IKT203Exam/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
8
Exam/IKT203Exam/.idea/modules.xml
generated
Normal file
8
Exam/IKT203Exam/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/IKT203-main.iml" filepath="$PROJECT_DIR$/.idea/IKT203-main.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
Exam/IKT203Exam/.idea/vcs.xml
generated
Normal file
6
Exam/IKT203Exam/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
28
Exam/IKT203Exam/CMakeLists.txt
Normal file
28
Exam/IKT203Exam/CMakeLists.txt
Normal file
@@ -0,0 +1,28 @@
|
||||
# Set the minimum version of CMake required to build this project.
|
||||
# This ensures that older versions of CMake don't try to run with features they don't understand.
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
# Define the project name. This will be the top-level name in Visual Studio.
|
||||
# It also enables the C++ language (CXX).
|
||||
project(IKT203_Course_Assignments LANGUAGES CXX)
|
||||
|
||||
# We enforce C++17 (or C++20 if you prefer) for the entire project.
|
||||
# All targets (exercises, libraries, etc.) will inherit this setting.
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_options("/Zc:__cplusplus")
|
||||
endif()
|
||||
|
||||
# This is the core of the orchestration. CMake will now step into each of these
|
||||
# folders and process their own CMakeLists.txt files.
|
||||
# The order matters here: we add LibExample first so that its library is
|
||||
# defined before the executables that need to link to it.
|
||||
|
||||
add_subdirectory(LibExample)
|
||||
add_subdirectory(Submissions)
|
||||
add_subdirectory(Portfolio)
|
||||
|
||||
# --- End of File ---
|
||||
61
Exam/IKT203Exam/CMakePresets.json
Normal file
61
Exam/IKT203Exam/CMakePresets.json
Normal file
@@ -0,0 +1,61 @@
|
||||
{
|
||||
"version": 3,
|
||||
"configurePresets": [
|
||||
{
|
||||
"name": "windows-base",
|
||||
"hidden": true,
|
||||
"generator": "Visual Studio 17 2022",
|
||||
"binaryDir": "${sourceDir}/out/build/${presetName}",
|
||||
"installDir": "${sourceDir}/out/install/${presetName}",
|
||||
"cacheVariables": {
|
||||
"CMAKE_C_COMPILER": "cl.exe",
|
||||
"CMAKE_CXX_COMPILER": "cl.exe"
|
||||
},
|
||||
"condition": {
|
||||
"type": "equals",
|
||||
"lhs": "${hostSystemName}",
|
||||
"rhs": "Windows"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x64-debug",
|
||||
"displayName": "x64 Debug",
|
||||
"inherits": "windows-base",
|
||||
"architecture": {
|
||||
"value": "x64",
|
||||
"strategy": "external"
|
||||
},
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x64-release",
|
||||
"displayName": "x64 Release",
|
||||
"inherits": "x64-debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x86-debug",
|
||||
"displayName": "x86 Debug",
|
||||
"inherits": "windows-base",
|
||||
"architecture": {
|
||||
"value": "x86",
|
||||
"strategy": "external"
|
||||
},
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Debug"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "x86-release",
|
||||
"displayName": "x86 Release",
|
||||
"inherits": "x86-debug",
|
||||
"cacheVariables": {
|
||||
"CMAKE_BUILD_TYPE": "Release"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
37
Exam/IKT203Exam/DATA/city_graph.txt
Normal file
37
Exam/IKT203Exam/DATA/city_graph.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
[NODES;records:=9]
|
||||
Oslo
|
||||
Bergen
|
||||
Trondheim
|
||||
Stavanger
|
||||
Kristiansand
|
||||
Ålesund
|
||||
Molde
|
||||
Bodø
|
||||
Tromsø
|
||||
[EDGES;records:=26]
|
||||
Oslo;Bergen;450
|
||||
Bergen;Oslo;460
|
||||
Oslo;Trondheim;820
|
||||
Trondheim;Oslo;790
|
||||
Oslo;Stavanger;600
|
||||
Stavanger;Oslo;650
|
||||
Bergen;Stavanger;210
|
||||
Stavanger;Bergen;190
|
||||
Bergen;Trondheim;540
|
||||
Trondheim;Bergen;520
|
||||
Trondheim;Ålesund;220
|
||||
Ålesund;Trondheim;240
|
||||
Ålesund;Bergen;310
|
||||
Bergen;Ålesund;300
|
||||
Stavanger;Kristiansand;180
|
||||
Kristiansand;Stavanger;170
|
||||
Kristiansand;Oslo;400
|
||||
Oslo;Kristiansand;410
|
||||
Trondheim;Bodø;600
|
||||
Bodø;Trondheim;620
|
||||
Bodø;Tromsø;500
|
||||
Tromsø;Bodø;480
|
||||
Ålesund;Molde;130
|
||||
Molde;Ålesund;120
|
||||
Molde;Trondheim;260
|
||||
Trondheim;Molde;250
|
||||
29
Exam/IKT203Exam/DATA/network_graph.txt
Normal file
29
Exam/IKT203Exam/DATA/network_graph.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
[NODES;records:=11]
|
||||
WebServer
|
||||
Router1
|
||||
AuthService
|
||||
CacheServer
|
||||
Database
|
||||
APIGateway
|
||||
LoadBalancer
|
||||
Firewall
|
||||
AnalyticsServer
|
||||
BackupServer
|
||||
FileServer
|
||||
[EDGES;records:=16]
|
||||
WebServer;Router1;4
|
||||
WebServer;AuthService;8
|
||||
WebServer;CacheServer;5
|
||||
Router1;Database;3
|
||||
Router1;LoadBalancer;2
|
||||
Router1;Firewall;7
|
||||
AuthService;Database;2
|
||||
AuthService;APIGateway;6
|
||||
CacheServer;LoadBalancer;4
|
||||
CacheServer;FileServer;3
|
||||
FileServer;BackupServer;9
|
||||
Database;AnalyticsServer;5
|
||||
APIGateway;AnalyticsServer;4
|
||||
LoadBalancer;Firewall;3
|
||||
Firewall;BackupServer;8
|
||||
AnalyticsServer;BackupServer;7
|
||||
5401
Exam/IKT203Exam/DATA/random_names.txt
Normal file
5401
Exam/IKT203Exam/DATA/random_names.txt
Normal file
File diff suppressed because it is too large
Load Diff
51
Exam/IKT203Exam/DATA/songs.txt
Normal file
51
Exam/IKT203Exam/DATA/songs.txt
Normal file
@@ -0,0 +1,51 @@
|
||||
[records:=50]
|
||||
Dire Straits;Love Over Gold;1984;rock;MusicBrainz
|
||||
Dire Straits;Expresso Love;1984;rock;MusicBrainz
|
||||
Dire Straits;Romeo and Juliet;1984;rock;MusicBrainz
|
||||
Dire Straits;Telegraph Road;1984;rock;MusicBrainz
|
||||
Dire Straits;Private Investigations;1984;rock;MusicBrainz
|
||||
Dire Straits;Tunnel of Love (intro: The Carousel Waltz);1984;rock;MusicBrainz
|
||||
Dire Straits;Once Upon a Time in the West;1984;rock;MusicBrainz
|
||||
Dire Straits;Going Home (theme from ‘Local Hero’);1984;rock;MusicBrainz
|
||||
Ry Cooder;634-5789 (Soulsville, U.S.A.);1980;rock;MusicBrainz
|
||||
Rush;The Body Electric;1984;rock;MusicBrainz
|
||||
Rush;Afterimage;1984;rock;MusicBrainz
|
||||
Rush;Kid Gloves;1984;rock;MusicBrainz
|
||||
Rush;Red Lenses;1984;rock;MusicBrainz
|
||||
Rush;Red Sector A;1984;rock;MusicBrainz
|
||||
Rush;Between the Wheels;1984;rock;MusicBrainz
|
||||
Barclay James Harvest;Say You’ll Stay;1984;rock;MusicBrainz
|
||||
Dire Straits;Solid Rock;1984;rock;MusicBrainz
|
||||
King Crimson;Model Man;1984;rock;MusicBrainz
|
||||
King Crimson;No Warning;1984;rock;MusicBrainz
|
||||
Queen;Tie Your Mother Down;1977;rock;MusicBrainz
|
||||
The Long Ryders;(Sweet) Mental Revenge;1984;rock;MusicBrainz
|
||||
Ry Cooder;Crazy ’bout an Automobile (Every Woman I Know);1980;rock;MusicBrainz
|
||||
Hawkwind;Jack of Shadows;1979;rock;MusicBrainz
|
||||
Kauko Röyhkä & Narttu;Pähkinäpuu;1984;rock;MusicBrainz
|
||||
Kauko Röyhkä & Narttu;Tuulee;1984;rock;MusicBrainz
|
||||
Echo & The Bunnymen;Seven Seas "Life At Brian's - Lean And Hungry";1984;rock;Discogs
|
||||
Billy Squier;Signs Of Life;1984;rock;Discogs
|
||||
Paul McCartney;No More Lonely Nights;1984;rock;Discogs
|
||||
Body Checks;Tätowiert + Kahlgeschoren;1984;rock;Discogs
|
||||
Trust (2);Serre Les Poings;1984;rock;Discogs
|
||||
Mama's Boys;Mama's Boys;1984;rock;Discogs
|
||||
Def Leppard;High 'N' Dry;1984;rock;Discogs
|
||||
Savage Republic;Tragic Figure;1984;rock;Discogs
|
||||
The Icicle Works;The Icicle Works;1984;rock;Discogs
|
||||
Twisted Sister;We're Not Gonna Take It;1984;rock;Discogs
|
||||
The Pogues;The Boys From The County Hell;1984;rock;Discogs
|
||||
The Takeaways;Sweet And Sour Volume 2;1984;rock;Discogs
|
||||
Rick Springfield;Beautiful Feelings;1984;rock;Discogs
|
||||
Vice Squad;Teenage Rampage;1984;rock;Discogs
|
||||
The Vipers (4);Outta The Nest;1984;rock;Discogs
|
||||
Rolands Gosskör;Genom Barriären;1984;rock;Discogs
|
||||
Willie Loco Alexander*;Taxi-Stand Diane;1984;rock;Discogs
|
||||
Kansas (2);The Best Of Kansas;1984;rock;Discogs
|
||||
The Rolling Stones;30 Años De Musica Rock - Salvat;1984;rock;Discogs
|
||||
Lindisfarne;Nicely Out Of Tune;1984;rock;Discogs
|
||||
Andy Summers;2010 / To Hal And Back;1984;rock;Discogs
|
||||
The Beatles;I Feel Fine;1984;rock;Discogs
|
||||
Neil Diamond;Love Songs;1984;rock;Discogs
|
||||
The Sensational Alex Harvey Band;Live;1984;rock;Discogs
|
||||
Subterfuge (10);Who's The Fool;1984;rock;Discogs
|
||||
32
Exam/IKT203Exam/LibExample/CMakeLists.txt
Normal file
32
Exam/IKT203Exam/LibExample/CMakeLists.txt
Normal file
@@ -0,0 +1,32 @@
|
||||
# --- Step 1: Create the Library ---
|
||||
|
||||
# Define a library target named "LibExample".
|
||||
# We use INTERFACE because it only contains .hpp files (header-only).
|
||||
# There are no .cpp files to compile here.
|
||||
# TODO: Change to STATIC if you add .cpp files later.
|
||||
add_library(LibExample INTERFACE)
|
||||
|
||||
# --- Step 2: Add Header Files to the Library ---
|
||||
|
||||
# This command explicitly lists the header files that belong to the library.
|
||||
# This helps Visual Studio display them nicely in the Solution Explorer.
|
||||
target_sources(LibExample
|
||||
PUBLIC
|
||||
list.hpp
|
||||
TSingleLinkedListTemplate.hpp
|
||||
TDoublyLinkedListTemplate.hpp
|
||||
TCircularDoublyLinkedListTemplate.hpp
|
||||
queue.hpp
|
||||
stack.hpp
|
||||
)
|
||||
|
||||
# --- Step 3: Make Headers "Findable" ---
|
||||
|
||||
# This is the most important command here.
|
||||
# It tells any other project that links to "LibExample" to add this
|
||||
# directory (CMAKE_CURRENT_SOURCE_DIR) to its list of include paths.
|
||||
# This is what allows you to write #include "list.hpp" in your main.cpp.
|
||||
# Note: CMAKE_CURRENT_SOURCE_DIR is a built-in variable that points to the directory
|
||||
target_include_directories(LibExample INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
#TODO: Change INTERFACE to PUBLIC if you add .cpp files later.
|
||||
|
||||
454
Exam/IKT203Exam/LibExample/TCircularDoublyLinkedListTemplate.hpp
Normal file
454
Exam/IKT203Exam/LibExample/TCircularDoublyLinkedListTemplate.hpp
Normal file
@@ -0,0 +1,454 @@
|
||||
// Implantation of the Circular Doubly Linked List
|
||||
|
||||
#ifndef TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP
|
||||
#define TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP
|
||||
#pragma once
|
||||
|
||||
#include "TDoublyLinkedListTemplate.hpp"
|
||||
|
||||
template <typename T>
|
||||
class TCircularDoublyLinkedList : public TDoublyLinkedList<T> {
|
||||
private:
|
||||
|
||||
// Helper to remove a node, updating both next and prev pointers
|
||||
void InternalRemoveNode(TNode<T>* aNodeToDelete);
|
||||
|
||||
protected:
|
||||
// --- New Member Variable ---
|
||||
TNode<T>* cursor; // Points to the "current" node in the list.
|
||||
|
||||
public:
|
||||
using TSingleLinkedList<T>::Append;
|
||||
using TSingleLinkedList<T>::Prepend;
|
||||
|
||||
// --- Constructor & Destructor ---
|
||||
TCircularDoublyLinkedList(bool aIsDataOwner);
|
||||
virtual ~TCircularDoublyLinkedList() override;
|
||||
|
||||
// --- New Cursor Management Methods ---
|
||||
void ResetCursor();
|
||||
T GetCursorData() const;
|
||||
void AdvanceCursor(int aSteps = 1);
|
||||
void RewindCursor(int aSteps = 1);
|
||||
int GetCursorIndex() const;
|
||||
|
||||
|
||||
// --- Overridden Virtual Methods ---
|
||||
// For maintaining the circular link
|
||||
void Append(const T&) override;
|
||||
void Prepend(const T&) override;
|
||||
void Remove(const T&) override;
|
||||
void RemoveAll(const T&) override;
|
||||
T RemoveLast() override;
|
||||
void Reverse() override;
|
||||
void ReverseSublist(int, int) override;
|
||||
void Merge(TSingleLinkedList<T>& otherList) override;
|
||||
|
||||
// For avoiding infinite loops
|
||||
bool Contains(const T&) const override;
|
||||
T Search(const T&, FCheckNode<T>) const override;
|
||||
void ForEach(FVisitNode<T>) const override;
|
||||
TNode<T>* GetMiddle() const override;
|
||||
};
|
||||
|
||||
// Constructor: Establishes the initial circular link where the head points to itself.
|
||||
template <typename T>
|
||||
TCircularDoublyLinkedList<T>::TCircularDoublyLinkedList(bool aIsDataOwner)
|
||||
: TDoublyLinkedList<T>(aIsDataOwner) {
|
||||
// An empty circular list's dummy head points to itself.
|
||||
this->head->SetNext(this->head);
|
||||
this->head->SetPrev(this->head);
|
||||
this->cursor = this->head; // Cursor also starts at the head.
|
||||
}
|
||||
|
||||
// Destructor: The parent destructors are virtual and will handle cleanup.
|
||||
template <typename T>
|
||||
TCircularDoublyLinkedList<T>::~TCircularDoublyLinkedList() {
|
||||
// Before the parent destructors run, we must break the circular link.
|
||||
// The parent's `nullptr`-terminated cleanup loop will now work correctly.
|
||||
if (!this->IsEmpty()) {
|
||||
// The tail is the node before the dummy head.
|
||||
// Set its 'next' pointer to null instead of back to the head.
|
||||
this->head->GetPrev()->SetNext(nullptr);
|
||||
}
|
||||
// Now, the chain is broken: head -> node1 -> ... -> tail -> nullptr
|
||||
// The TDoublyLinkedList and TSingleLinkedList destructors will be called
|
||||
// automatically after this, and they will now function correctly.
|
||||
}
|
||||
|
||||
// Moves the cursor to the first element in the list.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::ResetCursor() {
|
||||
if (this->IsEmpty()) {
|
||||
this->cursor = this->head;
|
||||
}
|
||||
else {
|
||||
this->cursor = this->head->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
// Returns the data at the cursor's current position.
|
||||
template <typename T>
|
||||
T TCircularDoublyLinkedList<T>::GetCursorData() const {
|
||||
// The cursor is only valid if it's not pointing to the dummy head.
|
||||
if (!this->IsEmpty() && this->cursor != this->head) {
|
||||
return this->cursor->GetData();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Moves the cursor forward, wrapping around if needed.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::AdvanceCursor(int aSteps) {
|
||||
if (this->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < aSteps; ++i) {
|
||||
this->cursor = this->cursor->GetNext();
|
||||
// If we move to the dummy head, we've wrapped around. Skip over it to the first element.
|
||||
if (this->cursor == this->head) {
|
||||
this->cursor = this->head->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Moves the cursor backward, wrapping around if needed.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::RewindCursor(int aSteps) {
|
||||
if (this->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < aSteps; ++i) {
|
||||
this->cursor = this->cursor->GetPrev();
|
||||
// If we move to the dummy head, we've wrapped around. Skip over it to the last element.
|
||||
if (this->cursor == this->head) {
|
||||
this->cursor = this->head->GetPrev();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Gets the numerical index of the cursor's current position.
|
||||
template <typename T>
|
||||
int TCircularDoublyLinkedList<T>::GetCursorIndex() const {
|
||||
if (this->IsEmpty() || this->cursor == this->head) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int index = 0;
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
|
||||
// Traverse the list safely, knowing it will eventually loop back to the head.
|
||||
while (current != this->head) {
|
||||
if (current == this->cursor) {
|
||||
return index;
|
||||
}
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
|
||||
return -1; // Should not be reached if cursor is valid.
|
||||
}
|
||||
|
||||
// Appends a node to the end of the list (before the dummy head).
|
||||
// Use the InternAppend from TDoublyLinkedList for basic logic, then adjust prev pointers.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Append(const T& aData) {
|
||||
// 1. Let the base class do ALL the standard work.
|
||||
TDoublyLinkedList<T>::Append(aData);
|
||||
// 2. Now fix the circular links.
|
||||
if(!this->IsEmpty()) {
|
||||
this->head->SetPrev(this->tail); // Dummy head's prev points to new tail
|
||||
this->tail->SetNext(this->head); // New tail's next points to dummy head
|
||||
}
|
||||
}
|
||||
|
||||
// Prepends a node to the beginning of the list (after the dummy head).
|
||||
// Use the Prepend from TDoublyLinkedList, this will handle all the logic.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Prepend(const T& aData) {
|
||||
TDoublyLinkedList<T>::Prepend(aData);
|
||||
// No need to adjust circular links, as TDoublyLinkedList::Prepend already does it.
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::InternalRemoveNode(TNode<T>* aNodeToDelete) {
|
||||
if (aNodeToDelete == nullptr || aNodeToDelete == this->head) return; // Invalid input
|
||||
|
||||
// 1. Update cursor if it points to the node being deleted
|
||||
if (this->cursor == aNodeToDelete) {
|
||||
this->cursor = aNodeToDelete->GetNext();
|
||||
}
|
||||
|
||||
//2. Update tail if the last node is being removed
|
||||
if (aNodeToDelete == this->tail) {
|
||||
this->tail = aNodeToDelete->GetPrev();
|
||||
}
|
||||
|
||||
// 3. Relink neighbors (this maintains the circle automatically)
|
||||
TNode<T>* prevNode = aNodeToDelete->GetPrev();
|
||||
TNode<T>* nextNode = aNodeToDelete->GetNext();
|
||||
prevNode->SetNext(nextNode);
|
||||
nextNode->SetPrev(prevNode);
|
||||
|
||||
// 4. Delete data if owned, then delete the node
|
||||
if (this->isDataOwner) {
|
||||
delete aNodeToDelete->GetData();
|
||||
}
|
||||
delete aNodeToDelete;
|
||||
this->size--;
|
||||
|
||||
// 5. If the list is now empty, ensure tail and cursor point to the head.
|
||||
if (this->IsEmpty()) {
|
||||
this->tail = this->head;
|
||||
this->cursor = this->head;
|
||||
}
|
||||
}
|
||||
|
||||
// Removes the first node with the given value.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Remove(const T& aData) {
|
||||
if (this->IsEmpty()) return;
|
||||
|
||||
// Start searching from the first actual node
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
// Traverse the entire circle once
|
||||
for (int i = 0; i < this->size; ++i) {
|
||||
if (current->GetData() == aData) {
|
||||
TNode<T>* prevNode = current->GetPrev();
|
||||
TNode<T>* nextNode = current->GetNext();
|
||||
|
||||
// Update tail if the last node is being removed
|
||||
if (current == this->tail) {
|
||||
this->tail = prevNode;
|
||||
}
|
||||
|
||||
// Relink neighbors (this maintains the circle automatically)
|
||||
prevNode->SetNext(nextNode);
|
||||
nextNode->SetPrev(prevNode);
|
||||
|
||||
if (this->isDataOwner) {
|
||||
delete current->GetData();
|
||||
}
|
||||
delete current;
|
||||
this->size--;
|
||||
return;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
// Removes the last element from the list.
|
||||
template <typename T>
|
||||
T TCircularDoublyLinkedList<T>::RemoveLast() {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* nodeToRemove = this->tail;
|
||||
T dataToReturn = nodeToRemove->GetData();
|
||||
TNode<T>* newTail = nodeToRemove->GetPrev();
|
||||
|
||||
// Relink the new tail to the head to maintain the circle
|
||||
newTail->SetNext(this->head);
|
||||
this->head->SetPrev(newTail);
|
||||
|
||||
this->tail = newTail; // Update tail pointer
|
||||
|
||||
delete nodeToRemove;
|
||||
this->size--;
|
||||
|
||||
if (this->IsEmpty()) {
|
||||
this->tail = this->head; // Reset tail if list is now empty
|
||||
}
|
||||
|
||||
return dataToReturn;
|
||||
}
|
||||
|
||||
// Removes all occurrences of a given value using a safe, bounded loop.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::RemoveAll(const T& aData) {
|
||||
if (this->IsEmpty()) return;
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
int initialSize = this->size; // Loop based on the original size
|
||||
|
||||
for (int i = 0; i < initialSize; ++i) {
|
||||
TNode<T>* nextNode = current->GetNext(); // Get next node before potential deletion
|
||||
|
||||
if (current->GetData() == aData) {
|
||||
TNode<T>* prevNode = current->GetPrev();
|
||||
|
||||
if (current == this->tail) {
|
||||
this->tail = prevNode;
|
||||
}
|
||||
|
||||
prevNode->SetNext(nextNode);
|
||||
nextNode->SetPrev(prevNode);
|
||||
|
||||
if (this->isDataOwner) {
|
||||
delete current->GetData();
|
||||
}
|
||||
delete current;
|
||||
this->size--;
|
||||
}
|
||||
current = nextNode;
|
||||
}
|
||||
if (this->IsEmpty()) {
|
||||
this->tail = this->head;
|
||||
}
|
||||
}
|
||||
|
||||
// Reverses the entire list by swapping the next/prev pointers of every node.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Reverse() {
|
||||
if (this->size <= 1) return; // Nothing to reverse
|
||||
|
||||
// 1. Keep track of original head and tail nodes.
|
||||
TNode<T>* newFirstNode = this->tail;
|
||||
|
||||
// 2. Iterate through all nodes, swapping next and prev pointers.
|
||||
TNode<T>* current = this->head;
|
||||
// We must loop size + 1 times to include the dummy head in the pointer swap.
|
||||
for (int i = 0; i < this->size + 1; ++i) {
|
||||
current->SwapNextPrev();
|
||||
// The *new* prev pointer is the *original* next pointer, so this moves us forward.
|
||||
current = current->GetPrev();
|
||||
}
|
||||
|
||||
// 3. Correct the head and tail pointers.
|
||||
this->tail = this->head->GetNext(); // The old head is the new tail.
|
||||
this->head->SetNext(newFirstNode); // The dummy head now points to the old tail.
|
||||
newFirstNode->SetPrev(this->head); // New first node's prev points to dummy head.
|
||||
}
|
||||
|
||||
// Reverses a portion of the list, ensuring circular links are maintained.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::ReverseSublist(int start, int end) {
|
||||
if (start < 0 || end >= this->size || start >= end) {
|
||||
return;
|
||||
}
|
||||
|
||||
// --- 1. Find boundary nodes ---
|
||||
TNode<T>* startNode = this->head->GetNext();
|
||||
for (int i = 0; i < start; ++i) {
|
||||
startNode = startNode->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* endNode = startNode;
|
||||
for (int i = start; i < end; ++i) {
|
||||
endNode = endNode->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* startPrev = startNode->GetPrev();
|
||||
TNode<T>* endNext = endNode->GetNext();
|
||||
|
||||
// --- 2. Reverse pointers for all nodes within the sublist ---
|
||||
TNode<T>* current = startNode;
|
||||
for (int i = 0; i <= (end - start); ++i) {
|
||||
TNode<T>* temp = current->GetNext();
|
||||
current->SetNext(current->GetPrev());
|
||||
current->SetPrev(temp);
|
||||
current = temp;
|
||||
}
|
||||
|
||||
// --- 3. Re-stitch the sublist (no nullptr checks needed) ---
|
||||
startPrev->SetNext(endNode);
|
||||
endNode->SetPrev(startPrev);
|
||||
startNode->SetNext(endNext);
|
||||
endNext->SetPrev(startNode);
|
||||
|
||||
// Update tail pointer if it was part of the reversed segment
|
||||
if (this->head->GetPrev() == endNode) { // Original startNode is now at the end
|
||||
this->tail = startNode;
|
||||
}
|
||||
}
|
||||
|
||||
// Merges another sorted list, creating a single, sorted circular list.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::Merge(TSingleLinkedList<T>& otherList) {
|
||||
// We can call the parent implementation to do the heavy lifting of merging.
|
||||
TDoublyLinkedList<T>::Merge(otherList);
|
||||
|
||||
// The parent merge results in a null-terminated list. We just need to fix the ends.
|
||||
if (!this->IsEmpty()) {
|
||||
TNode<T>* firstNode = this->head->GetNext();
|
||||
this->tail->SetNext(firstNode);
|
||||
firstNode->SetPrev(this->tail);
|
||||
}
|
||||
}
|
||||
|
||||
// Applies a function to each node using a safe loop for a circular list.
|
||||
template <typename T>
|
||||
void TCircularDoublyLinkedList<T>::ForEach(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr || this->IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
int index = 0;
|
||||
while (current != this->head) {
|
||||
aVisitNode(current->GetData(), index);
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Checks if a value is in the list using a safe, non-infinite loop.
|
||||
template <typename T>
|
||||
bool TCircularDoublyLinkedList<T>::Contains(const T& aData) const {
|
||||
if (this->IsEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != this->head) {
|
||||
if (current->GetData() == aData) {
|
||||
return true;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Searches for a value using a safe, non-infinite loop.
|
||||
template <typename T>
|
||||
T TCircularDoublyLinkedList<T>::Search(const T& aData, FCheckNode<T> aCheckNode) const {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != this->head) {
|
||||
if (aCheckNode != nullptr) {
|
||||
if (aCheckNode(current->GetData(), aData)) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (current->GetData() == aData) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Finds the middle node by traversing to the size/2 index.
|
||||
template <typename T>
|
||||
TNode<T>* TCircularDoublyLinkedList<T>::GetMiddle() const {
|
||||
if (this->IsEmpty()) return nullptr;
|
||||
|
||||
// The safest way for a list where we know the size.
|
||||
int middleIndex = this->size / 2;
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
for (int i = 0; i < middleIndex; ++i) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
#endif // TCIRCULARDOUBLYLINKEDLISTTEMPLATE_HPP
|
||||
340
Exam/IKT203Exam/LibExample/TDoublyLinkedListTemplate.hpp
Normal file
340
Exam/IKT203Exam/LibExample/TDoublyLinkedListTemplate.hpp
Normal file
@@ -0,0 +1,340 @@
|
||||
// TDoublyLinkedList implements a doubly linked list data structure with basic functionalities.
|
||||
|
||||
#ifndef TDOUBLYLINKEDLISTTEMPLEATE_HPP
|
||||
#define TDOUBLYLINKEDLISTTEMPLEATE_HPP
|
||||
#pragma once
|
||||
#include "TSingleLinkedListTemplate.hpp"
|
||||
|
||||
// Doubly Linked List inheriting from TSingleLinkedList
|
||||
template <typename T>
|
||||
class TDoublyLinkedList : public TSingleLinkedList<T> {
|
||||
private:
|
||||
// Internal helper to remove a node, updating both next and prev pointers
|
||||
void InternalRemoveNode(TNode<T>* aNodeToDelete);
|
||||
|
||||
public:
|
||||
using TSingleLinkedList<T>::Append;
|
||||
using TSingleLinkedList<T>::Prepend;
|
||||
|
||||
// --- Constructor & Destructor ---
|
||||
// Constructor calls the base class's constructor to initialize common members.
|
||||
TDoublyLinkedList(bool aIsDataOwner);
|
||||
|
||||
// The destructor is also virtual, ensuring the correct cleanup chain.
|
||||
virtual ~TDoublyLinkedList() override;
|
||||
|
||||
|
||||
// --- Overridden Virtual Methods from TSingleLinkedList ---
|
||||
// These methods provide new implementations to manage the 'prev' pointer
|
||||
// and/or to improve performance.
|
||||
virtual void Append(const T&) override;
|
||||
virtual void Prepend(const T&) override;
|
||||
virtual T GetAtIndex(int) override;
|
||||
virtual void Remove(const T&) override;
|
||||
virtual void Reverse() override;
|
||||
virtual void Merge(TSingleLinkedList<T>&) override;
|
||||
virtual void RemoveAll(const T&) override;
|
||||
virtual void ReverseSublist(int, int) override;
|
||||
virtual T RemoveLast();
|
||||
|
||||
|
||||
// --- New Methods Unique to TDoublyLinkedList ---
|
||||
// These methods leverage the 'prev' pointer for capabilities that are
|
||||
// inefficient or impossible in a singly-linked list.
|
||||
|
||||
void InsertBefore(TNode<T>*, T&);
|
||||
void ForEachReverse(FVisitNode<T>) const;
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
inline void TDoublyLinkedList<T>::InternalRemoveNode(TNode<T>* aNodeToDelete)
|
||||
{
|
||||
if (aNodeToDelete == nullptr || aNodeToDelete == this->head) return;
|
||||
TNode<T>* prevNode = aNodeToDelete->GetPrev();
|
||||
TNode<T>* nextNode = aNodeToDelete->GetNext();
|
||||
if (prevNode != nullptr) {
|
||||
prevNode->SetNext(nextNode);
|
||||
}
|
||||
if (nextNode != nullptr) {
|
||||
nextNode->SetPrev(prevNode);
|
||||
}
|
||||
if (aNodeToDelete == this->tail) {
|
||||
this->tail = prevNode;
|
||||
}
|
||||
if (this->isDataOwner) {
|
||||
delete aNodeToDelete->GetData();
|
||||
}
|
||||
delete aNodeToDelete;
|
||||
this->size--;
|
||||
}
|
||||
|
||||
// Constructor: Calls the base class constructor to perform initialization.
|
||||
template <typename T>
|
||||
TDoublyLinkedList<T>::TDoublyLinkedList(bool aIsDataOwner)
|
||||
: TSingleLinkedList<T>(aIsDataOwner) {}
|
||||
|
||||
// Destructor: The base class destructor is virtual, so this is called automatically.
|
||||
// No new resources were allocated, so the body can be empty.
|
||||
template <typename T>
|
||||
TDoublyLinkedList<T>::~TDoublyLinkedList() {} // No additional cleanup needed, the base class handles it.
|
||||
|
||||
// Append: Overridden to correctly set the 'prev' pointer on the new node.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Append(const T& aData) {
|
||||
TNode<T>* oldTail = this->tail;
|
||||
TNode<T>* newNode = this->InternAppend(aData);
|
||||
newNode->SetPrev(oldTail); // Set the new node's prev to the old tail
|
||||
}
|
||||
|
||||
// Prepend: Overridden to correctly set 'prev' pointers on the new node and its old neighbor.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Prepend(const T& aData) {
|
||||
TNode<T>* newNode = this->InternPrepend(aData);
|
||||
newNode->SetPrev(this->head); // New node's prev points to dummy head
|
||||
if (newNode->GetNext() != nullptr) {
|
||||
newNode->GetNext()->SetPrev(newNode); // Old first node's prev points to new node
|
||||
}
|
||||
}
|
||||
|
||||
// GetAtIndex: Re-introduces the performance optimization to search from the tail.
|
||||
template <typename T>
|
||||
T TDoublyLinkedList<T>::GetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= this->size) {
|
||||
return nullptr; // Index out of bounds
|
||||
}
|
||||
|
||||
TNode<T>* current;
|
||||
// Check which end is closer and traverse from there.
|
||||
if (aIndex < this->size / 2) {
|
||||
current = this->head->GetNext();
|
||||
for (int i = 0; i < aIndex; i++) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
else {
|
||||
current = this->tail;
|
||||
for (int i = this->size - 1; i > aIndex; i--) {
|
||||
current = current->GetPrev();
|
||||
}
|
||||
}
|
||||
return current->GetData();
|
||||
}
|
||||
|
||||
// Remove: Removes all nodes matching the given value.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Remove(const T& aData) {
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aData) {
|
||||
TNode<T>* nodeToRemove = current;
|
||||
current = current->GetNext(); // Move current forward before deletion
|
||||
InternalRemoveNode(nodeToRemove);
|
||||
}
|
||||
else {
|
||||
// No match, just advance current
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Reverse: Uses the much simpler algorithm of swapping prev/next pointers.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Reverse() {
|
||||
if (this->size <= 1) return;
|
||||
|
||||
// 1. Keep track of original head and tail nodes.
|
||||
TNode<T>* originalHeadNode = this->head->GetNext();
|
||||
TNode<T>* originalTailNode = this->tail;
|
||||
|
||||
// 2. Swap prev/next for every node.
|
||||
TNode<T>* current = originalHeadNode;
|
||||
while (current != nullptr) {
|
||||
current->SwapNextPrev();
|
||||
// The *new* prev pointer is the *original* next pointer, so this moves us forward.
|
||||
current = current->GetPrev();
|
||||
}
|
||||
|
||||
// 3. Correct the pointers for the new head and tail.
|
||||
this->tail = originalHeadNode; // The old head is the new tail.
|
||||
this->head->SetNext(originalTailNode); // The dummy head now points to the old tail.
|
||||
}
|
||||
|
||||
// RemoveLast: Removes the final element in O(1) time.
|
||||
// Note: This returns the data, so the caller is now responsible for it.
|
||||
// The data itself is not deleted, even if isDataOwner is true.
|
||||
template <typename T>
|
||||
T TDoublyLinkedList<T>::RemoveLast() {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* nodeToRemove = this->tail;
|
||||
T dataToReturn = nodeToRemove->GetData();
|
||||
|
||||
this->tail = this->tail->GetPrev();
|
||||
this->tail->SetNext(nullptr);
|
||||
|
||||
delete nodeToRemove;
|
||||
this->size--;
|
||||
|
||||
return dataToReturn;
|
||||
}
|
||||
|
||||
// InsertBefore: Inserts a new node before a specified node in O(1) time.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::InsertBefore(TNode<T>* aNode, T& aData) {
|
||||
if (aNode == nullptr || aNode == this->head) {
|
||||
// Cannot insert before a null node or the dummy head
|
||||
return;
|
||||
}
|
||||
|
||||
// If inserting before the first element, Prepend is easier.
|
||||
if (aNode == this->head->GetNext()) {
|
||||
Prepend(aData);
|
||||
return;
|
||||
}
|
||||
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
TNode<T>* prevNode = aNode->GetPrev();
|
||||
|
||||
// Link new node to its neighbors
|
||||
newNode->SetPrev(prevNode);
|
||||
newNode->SetNext(aNode);
|
||||
|
||||
// Update neighbors to point to the new node
|
||||
prevNode->SetNext(newNode);
|
||||
aNode->SetPrev(newNode);
|
||||
|
||||
this->size++;
|
||||
}
|
||||
|
||||
// ForEachReverse: Traverses the list backward from tail to head.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::ForEachReverse(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr) {
|
||||
return;
|
||||
}
|
||||
TNode<T>* current = this->tail;
|
||||
int index = this->size - 1;
|
||||
while (current != this->head) {
|
||||
aVisitNode(current->GetData(), index);
|
||||
current = current->GetPrev();
|
||||
index--;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::Merge(TSingleLinkedList<T>& otherList) {
|
||||
if (otherList.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int otherSize = otherList.GetSize();
|
||||
// Call the now-public StealNodes to legally take ownership of the nodes.
|
||||
TNode<T>* p2 = otherList.StealNodes();
|
||||
|
||||
if (this->IsEmpty()) {
|
||||
this->head->SetNext(p2);
|
||||
if (p2) p2->SetPrev(this->head);
|
||||
this->size = otherSize;
|
||||
// Find the new tail by traversing.
|
||||
TNode<T>* newTail = this->head;
|
||||
while (newTail->GetNext() != nullptr) {
|
||||
newTail = newTail->GetNext();
|
||||
}
|
||||
this->tail = newTail;
|
||||
return;
|
||||
}
|
||||
|
||||
TNode<T>* p1 = this->head->GetNext();
|
||||
TNode<T>* currentTail = this->head;
|
||||
|
||||
while (p1 != nullptr && p2 != nullptr) {
|
||||
if (p1->GetData() <= p2->GetData()) {
|
||||
currentTail->SetNext(p1);
|
||||
p1->SetPrev(currentTail);
|
||||
p1 = p1->GetNext();
|
||||
}
|
||||
else {
|
||||
currentTail->SetNext(p2);
|
||||
p2->SetPrev(currentTail);
|
||||
p2 = p2->GetNext();
|
||||
}
|
||||
currentTail = currentTail->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* remainder = (p1 != nullptr) ? p1 : p2;
|
||||
currentTail->SetNext(remainder);
|
||||
if (remainder != nullptr) {
|
||||
remainder->SetPrev(currentTail);
|
||||
}
|
||||
|
||||
this->size += otherSize;
|
||||
// After merging, find the new tail by traversing from where we left off.
|
||||
while (currentTail->GetNext() != nullptr) {
|
||||
currentTail = currentTail->GetNext();
|
||||
}
|
||||
this->tail = currentTail;
|
||||
}
|
||||
|
||||
// Remove: Removes all nodes matching the given value.
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::RemoveAll(const T& aValue) {
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
TNode<T>* nodeToRemove = current;
|
||||
current = current->GetNext(); // Move current forward before deletion
|
||||
InternalRemoveNode(nodeToRemove);
|
||||
}
|
||||
else {
|
||||
// No match, just advance the pointer
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ReverseSublist: Reverses a portion of the list between two indices (inclusive).
|
||||
template <typename T>
|
||||
void TDoublyLinkedList<T>::ReverseSublist(int start, int end) {
|
||||
if (start < 0 || end >= this->size || start >= end) return;
|
||||
|
||||
// --- 1. Find boundary nodes ---
|
||||
TNode<T>* startNode = this->head->GetNext();
|
||||
TNode<T>* endNode = startNode;
|
||||
|
||||
for (int i = 0; i < start; ++i) {
|
||||
startNode = startNode->GetNext();
|
||||
}
|
||||
for (int i = start; i < end; ++i) {
|
||||
endNode = endNode->GetNext();
|
||||
}
|
||||
|
||||
TNode<T>* startPrev = startNode->GetPrev();
|
||||
TNode<T>* endNext = endNode->GetNext();
|
||||
|
||||
// --- 2. Reverse pointers for all nodes within the sublist ---
|
||||
TNode<T>* current = startNode;
|
||||
while (current != endNext) {
|
||||
TNode<T>* temp = current->GetNext();
|
||||
current->SetNext(current->GetPrev());
|
||||
current->SetPrev(temp);
|
||||
current = temp; // Move to the original next node
|
||||
}
|
||||
|
||||
// --- 3. Re-stitch the reversed sublist into the main list ---
|
||||
startPrev->SetNext(endNode);
|
||||
endNode->SetPrev(startPrev);
|
||||
|
||||
startNode->SetNext(endNext);
|
||||
if (endNext != nullptr) {
|
||||
endNext->SetPrev(startNode);
|
||||
}
|
||||
else {
|
||||
// If we reversed to the end, the original startNode is the new tail
|
||||
this->tail = startNode;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // !TDOUBLYLINKEDLISTTEMPLEATE_HPP
|
||||
529
Exam/IKT203Exam/LibExample/TSingleLinkedListTemplate.hpp
Normal file
529
Exam/IKT203Exam/LibExample/TSingleLinkedListTemplate.hpp
Normal file
@@ -0,0 +1,529 @@
|
||||
#ifndef TSINGLELINKEDLIST_HPP
|
||||
#define TSINGLELINKEDLIST_HPP
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <type_traits> // Required for the Clone function, and prevent delete on non-pointer types
|
||||
#include "TDoublyLinkedListTemplate.hpp"
|
||||
#include "TCircularDoublyLinkedListTemplate.hpp"
|
||||
|
||||
template <typename T>
|
||||
class TDoublyLinkedList; // Forward declaration for friendship
|
||||
template <typename T>
|
||||
class TCircularDoublyLinkedList; // Forward declaration for friendship
|
||||
|
||||
// Callback type definitions
|
||||
template <typename T, typename TArgs>
|
||||
using FDataFactory = T(*)(TArgs); // <-- ADD THIS LINE
|
||||
|
||||
template <typename T>
|
||||
using FCheckNode = bool(*)(const T, const T);
|
||||
|
||||
template <typename T>
|
||||
using FVisitNode = void(*)(const T, int);
|
||||
|
||||
template <typename T>
|
||||
class TNode {
|
||||
private:
|
||||
T data; // Data of type T (e.g., TSong*)
|
||||
TNode* next; // Pointer to the next node
|
||||
TNode* prev; // Pointer to the previous node, prepared for future use
|
||||
|
||||
void SwapNextPrev(); // Swaps the next and prev pointers of this node
|
||||
public:
|
||||
// Constructor
|
||||
|
||||
TNode(const T& aData);
|
||||
|
||||
// Destructor
|
||||
~TNode();
|
||||
|
||||
// Getters
|
||||
T GetData() const { return data; }
|
||||
TNode* GetNext() const { return next; }
|
||||
TNode* GetPrev() const { return prev; }
|
||||
|
||||
// Setters
|
||||
void SetNext(TNode* aNextNode) { next = aNextNode; }
|
||||
void SetPrev(TNode* aPrevNode) { prev = aPrevNode; }
|
||||
|
||||
// Add friendships here if needed
|
||||
friend class TDoublyLinkedList<T>;
|
||||
friend class TCircularDoublyLinkedList<T>;
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the node with data from the factory function
|
||||
template <typename T>
|
||||
TNode<T>::TNode(const T& aData) : data(aData), next(nullptr), prev(nullptr) {}
|
||||
|
||||
// Destructor: Deletes the data pointer
|
||||
template <typename T>
|
||||
TNode<T>::~TNode() {
|
||||
//Do not delete data, data may exist outside the list
|
||||
data = nullptr; // Set data to nullptr to avoid dangling pointer
|
||||
next = nullptr; // Set next to nullptr to avoid dangling pointer
|
||||
prev = nullptr; // Set prev to nullptr to avoid dangling pointer
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TNode<T>::SwapNextPrev() {
|
||||
TNode* temp = next;
|
||||
next = prev;
|
||||
prev = temp;
|
||||
}
|
||||
|
||||
// --- End of TNode class ---
|
||||
|
||||
// Singly Linked List TSingleLinkedList using TNode<T> and dummy node
|
||||
template <typename T>
|
||||
class TSingleLinkedList {
|
||||
private:
|
||||
// Helper to reset the list to empty state
|
||||
void ResetList();
|
||||
|
||||
protected:
|
||||
TNode<T>* head; // Pointer to the dummy head node
|
||||
TNode<T>* tail; // Pointer to the tail node
|
||||
int size; // Current size of the list
|
||||
bool isDataOwner; // Indicates if the list owns the data
|
||||
|
||||
// Internal implementations can be non-virtual
|
||||
TNode<T>* InternAppend(const T&);
|
||||
TNode<T>* InternPrepend(const T&);
|
||||
|
||||
// Helper for RemoveAll to delete a node given its previous node
|
||||
void InternalRemoveNode(TNode<T>*, TNode<T>*);
|
||||
// Helper to get node at index (non-virtual, used internally)
|
||||
TNode<T>* GetNodeAtIndex(int aIndex) const;
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
TSingleLinkedList(bool);
|
||||
// Virtual Destructor
|
||||
virtual ~TSingleLinkedList();
|
||||
|
||||
// --- Core Operations (Virtual) ---
|
||||
virtual void Append(const T&);
|
||||
virtual void Prepend(const T&);
|
||||
virtual T GetAtIndex(int);
|
||||
virtual void Remove(const T&);
|
||||
virtual void Reverse();
|
||||
virtual void RemoveAll(const T&);
|
||||
virtual void ReverseSublist(int, int);
|
||||
virtual TNode<T>* GetMiddle() const;
|
||||
virtual void Merge(TSingleLinkedList<T>&);
|
||||
|
||||
// --- Traversal functions that MUST now be virtual ---
|
||||
virtual bool Contains(const T&) const;
|
||||
virtual T Search(const T&, FCheckNode<T> = nullptr) const;
|
||||
virtual void ForEach(FVisitNode<T>) const;
|
||||
|
||||
// --- Non-Virtual Methods ---
|
||||
template <typename TArgs>
|
||||
T Append(FDataFactory<T, TArgs>, TArgs);
|
||||
template <typename TArgs>
|
||||
T Prepend(FDataFactory<T, TArgs>, TArgs);
|
||||
int GetSize() const;
|
||||
bool IsEmpty() const;
|
||||
TSingleLinkedList<T> Clone() const;
|
||||
TNode<T>* StealNodes();
|
||||
};
|
||||
|
||||
// Constructor: Initializes the dummy head node and list state
|
||||
template <typename T>
|
||||
TSingleLinkedList<T>::TSingleLinkedList(bool aIsDataOwner)
|
||||
: head(new TNode<T>(nullptr)), tail(head), size(0), isDataOwner(aIsDataOwner) {
|
||||
// COMPILE-TIME SAFETY CHECK
|
||||
// If the user tries to create a list of non-pointer types with ownership,
|
||||
// stop compilation with a static_assert.
|
||||
static_assert(std::is_pointer<T>::value || !aIsDataOwner,
|
||||
"isDataOwner can only be true if T is a pointer type (e.g., std::string*).");
|
||||
}
|
||||
|
||||
// Virtual Destructor: Deletes all nodes and, if owner, the data
|
||||
template <typename T>
|
||||
TSingleLinkedList<T>::~TSingleLinkedList() {
|
||||
TNode<T>* current = head;
|
||||
while (current != nullptr) {
|
||||
TNode<T>* nextNode = current->GetNext();
|
||||
if (isDataOwner && current->GetData() != nullptr) {
|
||||
delete current->GetData(); // Delete data if the list owns it
|
||||
}
|
||||
delete current; // Free the node itself
|
||||
current = nextNode;
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::InternalRemoveNode(TNode<T>* aPrevNode, TNode<T>* aNodeToDelete) {
|
||||
if (aPrevNode == nullptr || aNodeToDelete == nullptr) return;
|
||||
aPrevNode->SetNext(aNodeToDelete->GetNext());
|
||||
if (aNodeToDelete == this->tail) {
|
||||
this->tail = aPrevNode;
|
||||
}
|
||||
if (this->isDataOwner) {
|
||||
delete aNodeToDelete->GetData();
|
||||
}
|
||||
delete aNodeToDelete;
|
||||
this->size--;
|
||||
}
|
||||
|
||||
|
||||
// StealNodes: Detaches and returns the list's nodes, leaving it empty
|
||||
// Uses ResetList to clear the list state
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::StealNodes() {
|
||||
TNode<T>* stolenHead = head->GetNext(); // First actual node
|
||||
this->ResetList(); // Clear the list to empty state
|
||||
return stolenHead; // Return the detached nodes
|
||||
}
|
||||
|
||||
// InternAppend: Handles the logic of adding a node to the end
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::InternAppend(const T& aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
tail->SetNext(newNode); // Link the old tail to the new node
|
||||
tail = newNode; // Update the tail pointer
|
||||
size++;
|
||||
return newNode;
|
||||
}
|
||||
|
||||
// Public Append method
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Append(const T& aData) {
|
||||
InternAppend(aData);
|
||||
}
|
||||
|
||||
// InternPrepend: Handles the logic of adding a node to the beginning
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::InternPrepend(const T& aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
newNode->SetNext(head->GetNext());
|
||||
head->SetNext(newNode);
|
||||
if (tail == head) { // If the list was empty, new node is also the tail
|
||||
tail = newNode;
|
||||
}
|
||||
size++;
|
||||
return newNode;
|
||||
}
|
||||
|
||||
// Public Prepend method
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Prepend(const T& aData) {
|
||||
InternPrepend(aData);
|
||||
}
|
||||
|
||||
// Append(): Creates a new node with the given factory and returns the new node's data.
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TSingleLinkedList<T>::Append(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if (aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
this->Append(newData); // Call the existing virtual Append(T) method
|
||||
return newData;
|
||||
}
|
||||
|
||||
// Prepend(): Creates a new node with the given factory and returns the new node's data.
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TSingleLinkedList<T>::Prepend(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if (aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
this->Prepend(newData); // Call the existing virtual Prepend(T) method
|
||||
return newData;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::GetNodeAtIndex(int aIndex) const {
|
||||
TNode<T>* current = head->GetNext(); // Start at the first actual node
|
||||
for (int i = 0; i < aIndex; ++i) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
// GetAtIndex: Returns the value at a specified index.
|
||||
// This version iterates from the beginning only, as it cannot go backward.
|
||||
template <typename T>
|
||||
T TSingleLinkedList<T>::GetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= size) {
|
||||
return nullptr; // Index out of bounds
|
||||
}
|
||||
return GetNodeAtIndex(aIndex)->GetData();
|
||||
}
|
||||
|
||||
// Remove: Removes the first node matching the given value.
|
||||
// Requires tracking the previous node to relink the list.
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Remove(const T& aData) {
|
||||
TNode<T>* prev = head;
|
||||
TNode<T>* current = head->GetNext();
|
||||
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aData) {
|
||||
// Match found, remove the node
|
||||
InternalRemoveNode(prev, current);
|
||||
return; // Only remove the first occurrence
|
||||
}
|
||||
}
|
||||
prev = current;
|
||||
current = current->GetNext();
|
||||
}
|
||||
|
||||
// Reverse: Reverses the list using the classic iterative algorithm for singly-linked lists.
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Reverse() {
|
||||
if (size <= 1) {
|
||||
return; // Nothing to reverse
|
||||
}
|
||||
|
||||
// The original first node will become the new tail
|
||||
tail = head->GetNext();
|
||||
|
||||
TNode<T>* prevNode = nullptr;
|
||||
TNode<T>* currentNode = head->GetNext();
|
||||
TNode<T>* nextNode = nullptr;
|
||||
|
||||
while (currentNode != nullptr) {
|
||||
nextNode = currentNode->GetNext(); // Store next node
|
||||
currentNode->SetNext(prevNode); // Reverse the current node's pointer
|
||||
prevNode = currentNode; // Move pointers one position ahead
|
||||
currentNode = nextNode;
|
||||
}
|
||||
|
||||
// After the loop, prevNode is the new first node
|
||||
head->SetNext(prevNode);
|
||||
}
|
||||
|
||||
// Contains: Checks if the list contains the given value,
|
||||
// this is diffrent from Search as it only checks for existence
|
||||
// This using search with a nullptr as the check function
|
||||
template <typename T>
|
||||
bool TSingleLinkedList<T>::Contains(const T& aData) const {
|
||||
return Search(aData, nullptr) != nullptr;
|
||||
}
|
||||
|
||||
// Search: Finds a value using an optional custom comparison function
|
||||
template <typename T>
|
||||
T TSingleLinkedList<T>::Search(const T& aData, FCheckNode<T> aCheckNode) const {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
// Use the provided check function or default to direct comparison
|
||||
if (aCheckNode != nullptr) {
|
||||
if (aCheckNode(current->GetData(), aData)) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (current->GetData() == aData) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return nullptr; // Not found
|
||||
}
|
||||
|
||||
// ForEach: Applies a function to each node in the list
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::ForEach(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr) {
|
||||
return;
|
||||
}
|
||||
TNode<T>* current = head->GetNext();
|
||||
int index = 0;
|
||||
while (current != nullptr) {
|
||||
aVisitNode(current->GetData(), index);
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// GetSize: Returns the current number of elements in the list
|
||||
template <typename T>
|
||||
int TSingleLinkedList<T>::GetSize() const {
|
||||
return size;
|
||||
}
|
||||
|
||||
// IsEmpty: Checks if the list has any elements
|
||||
template <typename T>
|
||||
bool TSingleLinkedList<T>::IsEmpty() const {
|
||||
return size == 0;
|
||||
}
|
||||
|
||||
// RemoveAll: Removes all occurrences of a given value from the list.
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::RemoveAll(const T& aData) {
|
||||
TNode<T>* prev = this->head;
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aData) {
|
||||
// Match found, remove the node
|
||||
TNode<T>* nodeToDelete = current;
|
||||
current = current->GetNext(); // Advance current before deletion
|
||||
InternalRemoveNode(prev, nodeToDelete);
|
||||
// prev remains the same, as we just removed current
|
||||
}
|
||||
else {
|
||||
// No match, advance both pointers
|
||||
prev = current;
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Clone: Creates a deep copy of the list.
|
||||
template <typename T>
|
||||
TSingleLinkedList<T> TSingleLinkedList<T>::Clone() const {
|
||||
// Create a new list with the same ownership policy.
|
||||
TSingleLinkedList<T> newList(this->isDataOwner);
|
||||
|
||||
TNode<T>* current = this->head->GetNext();
|
||||
while (current != nullptr) {
|
||||
T dataToCopy = current->GetData();
|
||||
|
||||
// This is the core of the deep copy logic.
|
||||
if (this->isDataOwner && std::is_pointer<T>::value && dataToCopy != nullptr) {
|
||||
// If the list owns its pointer data, we must create a NEW object.
|
||||
// This assumes the underlying type has a copy constructor.
|
||||
// `std::remove_pointer_t<T>` gets the type T points to (e.g., TSong from TSong*).
|
||||
newList.Append(new std::remove_pointer_t<T>(*dataToCopy));
|
||||
}
|
||||
else {
|
||||
// For value types (int, double) or non-owned pointers, just copy the value.
|
||||
newList.Append(dataToCopy);
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return newList;
|
||||
}
|
||||
|
||||
// ReverseSublist: Reverses a portion of the list between two indices (inclusive).
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::ReverseSublist(int aStart, int aEnd) {
|
||||
// Validate indices
|
||||
if (aStart < 0 || aEnd >= this->size || aStart >= aEnd) return;
|
||||
|
||||
|
||||
// --- 1. Traverse to the nodes that define the sublist boundaries ---
|
||||
// Use the helper to find the node *before* the sublist starts
|
||||
TNode<T>* startNodePrev = (aStart == 0) ? this->head : this->GetNodeAtIndex(aStart - 1); // Node before the start of the sublist
|
||||
TNode<T>* sublistHead = startNodePrev->GetNext(); // First node of the sublist
|
||||
|
||||
// --- 2. Perform standard reversal on the sublist part only ---
|
||||
TNode<T>* prevNode = nullptr;
|
||||
TNode<T>* currentNode = sublistHead;
|
||||
TNode<T>* nextNode = nullptr;
|
||||
for (int i = 0; i <= (aEnd - aStart); ++i) {
|
||||
nextNode = currentNode->GetNext();
|
||||
currentNode->SetNext(prevNode);
|
||||
prevNode = currentNode;
|
||||
currentNode = nextNode;
|
||||
}
|
||||
|
||||
// --- 3. Stitch the reversed sublist back into the main list ---
|
||||
// 'prevNode' is now the new head of the reversed sublist.
|
||||
// 'sublistHead' is now the tail of the reversed sublist.
|
||||
startNodePrev->SetNext(prevNode);
|
||||
sublistHead->SetNext(currentNode);
|
||||
|
||||
// Update the main tail pointer if the reversal included the original tail.
|
||||
if (aEnd == this->size - 1) {
|
||||
this->tail = sublistHead;
|
||||
}
|
||||
}
|
||||
|
||||
// GetMiddle: Finds the middle node of the list using the fast/slow pointer algorithm.
|
||||
template <typename T>
|
||||
TNode<T>* TSingleLinkedList<T>::GetMiddle() const {
|
||||
if (this->IsEmpty()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TNode<T>* slow = this->head->GetNext();
|
||||
TNode<T>* fast = this->head->GetNext();
|
||||
|
||||
// The loop condition ensures 'fast' and 'fast->GetNext()' are valid.
|
||||
// When 'fast' reaches the end, 'slow' will be at the midpoint.
|
||||
while (fast != nullptr && fast->GetNext() != nullptr) {
|
||||
slow = slow->GetNext();
|
||||
fast = fast->GetNext()->GetNext();
|
||||
}
|
||||
|
||||
return slow;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::ResetList() {
|
||||
// Clear the list to an empty state
|
||||
this->head->SetNext(nullptr);
|
||||
this->tail = this->head;
|
||||
this->size = 0;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TSingleLinkedList<T>::Merge(TSingleLinkedList<T>& aOtherList) {
|
||||
// If the other list is empty, there's nothing to do.
|
||||
if (aOtherList.IsEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// If this list is empty, take ownership of the other list's nodes.
|
||||
if (this->IsEmpty()) {
|
||||
this->head->SetNext(aOtherList.head->GetNext());
|
||||
this->tail = aOtherList.tail;
|
||||
this->size = aOtherList.size;
|
||||
|
||||
// Clear the other list
|
||||
aOtherList.head->SetNext(nullptr);
|
||||
aOtherList.tail = aOtherList.head;
|
||||
aOtherList.size = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// Pointers to the current nodes in each list
|
||||
TNode<T>* p1 = this->head->GetNext();
|
||||
TNode<T>* p2 = aOtherList.head->GetNext();
|
||||
|
||||
// Use the dummy head of `this` list to start building the merged result.
|
||||
TNode<T>* tail = this->head;
|
||||
|
||||
// --- Main Loop: Traverse both lists and pick the smaller node ---
|
||||
while (p1 != nullptr && p2 != nullptr) {
|
||||
if (p1->GetData() <= p2->GetData()) {
|
||||
tail->SetNext(p1);
|
||||
p1 = p1->GetNext();
|
||||
}
|
||||
else {
|
||||
tail->SetNext(p2);
|
||||
p2 = p2->GetNext();
|
||||
}
|
||||
tail = tail->GetNext();
|
||||
}
|
||||
|
||||
// --- Append the Remainder ---
|
||||
tail->SetNext(p1 != nullptr ? p1 : p2);
|
||||
|
||||
// --- Update the Tail Pointer ---
|
||||
while (tail->GetNext() != nullptr) {
|
||||
tail = tail->GetNext();
|
||||
}
|
||||
this->tail = tail;
|
||||
|
||||
// --- Update Size ---
|
||||
this->size += aOtherList.size;
|
||||
|
||||
// --- Clear the Other List ---
|
||||
aOtherList.ResetList();
|
||||
}
|
||||
|
||||
// --- End of TSingleLinkedList class ---
|
||||
|
||||
#endif // !TSINGLELINKEDLIST_HPP
|
||||
309
Exam/IKT203Exam/LibExample/list.hpp
Normal file
309
Exam/IKT203Exam/LibExample/list.hpp
Normal file
@@ -0,0 +1,309 @@
|
||||
#pragma once
|
||||
#include <stdexcept> // For std::runtime_error
|
||||
#include <string> // For std::to_string
|
||||
|
||||
// Linked List using TNode<T> class with constructor and destructor
|
||||
template <typename T>
|
||||
class TNode {
|
||||
private:
|
||||
T data; // Data of type T (e.g., TSong*)
|
||||
TNode* next; // Pointer to the next node
|
||||
TNode* prev; // Pointer to the previous node
|
||||
public:
|
||||
// Constructor
|
||||
|
||||
TNode(T aData);
|
||||
|
||||
// Destructor
|
||||
~TNode();
|
||||
|
||||
// Getters
|
||||
T GetData() const { return data; }
|
||||
TNode* GetNext() const { return next; }
|
||||
TNode* GetPrev() const { return prev; }
|
||||
|
||||
// Setters
|
||||
void SetNext(TNode* aNextNode) { next = aNextNode; }
|
||||
void SetPrev(TNode* aPrevNode) { prev = aPrevNode; }
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the node with data from the factory function
|
||||
template <typename T>
|
||||
TNode<T>::TNode(T aData) : data(aData), next(nullptr), prev(nullptr) {}
|
||||
|
||||
// Destructor: Deletes the data pointer
|
||||
template <typename T>
|
||||
TNode<T>::~TNode() {
|
||||
//Do not delete data, data may exist outside the list
|
||||
data = nullptr; // Set data to nullptr to avoid dangling pointer
|
||||
next = nullptr; // Set next to nullptr to avoid dangling pointer
|
||||
prev = nullptr; // Set prev to nullptr to avoid dangling pointer
|
||||
}
|
||||
|
||||
// --- End of TNode class ---
|
||||
|
||||
// Type defined function for data factory
|
||||
template <typename T, typename TArgs>
|
||||
using FDataFactory = T(*)(TArgs);
|
||||
|
||||
// Type defined functions for TLinkedList
|
||||
template <typename T>
|
||||
using FCheckNode = bool(*)(const T, const T);
|
||||
|
||||
template <typename T>
|
||||
using FVisitNode = void(*)(const T, int);
|
||||
|
||||
// Linked List TLinkedList using TNode<T> and dummy node
|
||||
template <typename T>
|
||||
class TLinkedList {
|
||||
private:
|
||||
TNode<T>* head; // Pointer to the dummy head node
|
||||
TNode<T>* tail; // Pointer to the tail node
|
||||
int size; // Current size of the list
|
||||
bool isDataOwner; // Indicates if the list owns the data and should delete it
|
||||
|
||||
void InternAppend(T);
|
||||
void InternPrepend(T);
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
TLinkedList(bool);
|
||||
// Destructor
|
||||
~TLinkedList();
|
||||
|
||||
// Core Linked List Operations
|
||||
template <typename TArgs>
|
||||
T Append(FDataFactory<T, TArgs>, TArgs);
|
||||
void Append(T);
|
||||
|
||||
template <typename TArgs>
|
||||
T Prepend(FDataFactory<T, TArgs>, TArgs);
|
||||
void Prepend(T aValue);
|
||||
|
||||
T GetAtIndex(int aIndex);
|
||||
void Remove(const T aValue);
|
||||
|
||||
// Finding and Checking Operations
|
||||
bool Contains(const T aValue) const;
|
||||
T Search(const T aValue, FCheckNode<T> checkNode = nullptr) const;
|
||||
|
||||
// Loop Operations
|
||||
void ForEach(FVisitNode<T> aVisitNode) const;
|
||||
|
||||
// Helper Functions
|
||||
int GetSize() const;
|
||||
bool IsEmpty() const;
|
||||
void Reverse();
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the dummy head node and tail
|
||||
template <typename T>
|
||||
TLinkedList<T>::TLinkedList(bool aIsDataOwner) : size(0) {
|
||||
isDataOwner = aIsDataOwner;
|
||||
head = new TNode<T>(nullptr); // Create a dummy head node
|
||||
tail = head; // Initially, tail is the same as head
|
||||
}
|
||||
|
||||
// Destructor: Deletes all nodes in the list
|
||||
template <typename T>
|
||||
TLinkedList<T>::~TLinkedList() {
|
||||
TNode<T>* current = head;
|
||||
while (current != nullptr) {
|
||||
TNode<T>* nextNode = current->GetNext();
|
||||
if (isDataOwner && current->GetData() != nullptr) {
|
||||
delete current->GetData(); // Delete the data if the list owns it
|
||||
}
|
||||
delete current; // Free the current node
|
||||
current = nextNode; // Move to the next node
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::InternAppend(T aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
newNode->SetPrev(tail); // Set the prev pointer of the new node
|
||||
tail->SetNext(newNode); // Update the next pointer of the current tail
|
||||
tail = newNode; // Update the tail to the new node
|
||||
size++;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::InternPrepend(T aData) {
|
||||
TNode<T>* newNode = new TNode<T>(aData);
|
||||
newNode->SetNext(head->GetNext());
|
||||
if (head->GetNext() != nullptr) {
|
||||
head->GetNext()->SetPrev(newNode); // Update the prev pointer of the first node
|
||||
}
|
||||
head->SetNext(newNode);
|
||||
newNode->SetPrev(head); // Set the prev pointer of the new node
|
||||
if (tail == head) {
|
||||
tail = newNode;
|
||||
}
|
||||
size++;
|
||||
}
|
||||
|
||||
|
||||
// Append(): Adds a new node with the given factory and returns the new node's data
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TLinkedList<T>::Append(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if(aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
InternAppend(newData);
|
||||
return newData;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Append(T aValue) {
|
||||
InternAppend(aValue);
|
||||
}
|
||||
|
||||
// Prepend(): Adds a new node with the given factory to the beginning of the list
|
||||
template <typename T>
|
||||
template <typename TArgs>
|
||||
T TLinkedList<T>::Prepend(FDataFactory<T, TArgs> aDataFactory, TArgs aArgs) {
|
||||
if (aDataFactory == nullptr) {
|
||||
return nullptr; // Return nullptr if no factory is provided
|
||||
}
|
||||
T newData = aDataFactory(aArgs);
|
||||
InternPrepend(newData);
|
||||
return newData;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Prepend(T aValue) {
|
||||
InternPrepend(aValue);
|
||||
}
|
||||
|
||||
// GetAtIndex(): Returns the value at the specified index
|
||||
template <typename T>
|
||||
T TLinkedList<T>::GetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= size) {
|
||||
return nullptr; // Return nullptr if index is out of bounds
|
||||
}
|
||||
TNode<T>* current;
|
||||
if (aIndex < size / 2) {
|
||||
current = head->GetNext();
|
||||
for (int i = 0; i < aIndex; i++) {
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
else {
|
||||
current = tail;
|
||||
for (int i = size - 1; i > aIndex; i--) {
|
||||
current = current->GetPrev();
|
||||
}
|
||||
}
|
||||
return current->GetData(); // Return the data directly
|
||||
}
|
||||
|
||||
// Remove(): Removes the first node with the given value
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Remove(const T aValue) {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
TNode<T>* nodeToDelete = current;
|
||||
if (current->GetPrev() != nullptr) {
|
||||
current->GetPrev()->SetNext(current->GetNext());
|
||||
}
|
||||
if (current->GetNext() != nullptr) {
|
||||
current->GetNext()->SetPrev(current->GetPrev());
|
||||
}
|
||||
if (nodeToDelete == tail) {
|
||||
tail = current->GetPrev();
|
||||
}
|
||||
|
||||
if (isDataOwner && nodeToDelete->GetData() != nullptr) {
|
||||
delete nodeToDelete->GetData(); // Delete the data if the list owns it
|
||||
}
|
||||
delete nodeToDelete;
|
||||
size--;
|
||||
return;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
// Contains(): Checks if the list contains the given value
|
||||
template <typename T>
|
||||
bool TLinkedList<T>::Contains(const T aValue) const {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
return true;
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// Search(): Searches for a node with the given value using an optional check function
|
||||
template <typename T>
|
||||
T TLinkedList<T>::Search(const T aValue, FCheckNode<T> checkNode) const {
|
||||
TNode<T>* current = head->GetNext();
|
||||
while (current != nullptr) {
|
||||
if (checkNode == nullptr) {
|
||||
if (current->GetData() == aValue) {
|
||||
return current->GetData();
|
||||
}
|
||||
} else {
|
||||
if (checkNode(current->GetData(), aValue)) {
|
||||
return current->GetData();
|
||||
}
|
||||
}
|
||||
current = current->GetNext();
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ForEach(): Applies a function to each node in the list
|
||||
template <typename T>
|
||||
void TLinkedList<T>::ForEach(FVisitNode<T> aVisitNode) const {
|
||||
if (aVisitNode == nullptr) {
|
||||
return; // Return if no visit function is provided
|
||||
}
|
||||
TNode<T>* current = head->GetNext();
|
||||
int index = 0;
|
||||
while (current != nullptr) {
|
||||
aVisitNode(static_cast<const T>(current->GetData()), index); // Cast to const T
|
||||
current = current->GetNext();
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
// Reverse(): Reverses the order of the nodes in the list
|
||||
template <typename T>
|
||||
void TLinkedList<T>::Reverse() {
|
||||
TNode<T>* current = head->GetNext();
|
||||
TNode<T>* temp = nullptr; // Temporary pointer for swapping
|
||||
|
||||
// Handle an empty or single-node list
|
||||
if (current == nullptr || current->GetNext() == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Iterate and swap next and prev pointers
|
||||
while (current != nullptr) {
|
||||
temp = current->GetPrev(); // Store prev pointer
|
||||
current->SetPrev(current->GetNext()); // Set prev to next
|
||||
current->SetNext(temp); // Set next to temp (which holds original prev)
|
||||
current = current->GetPrev(); // Move to the original next node
|
||||
}
|
||||
|
||||
// Update head and tail
|
||||
TNode<T>* newHeadNext = tail; // The original tail becomes the new head->next
|
||||
tail = head->GetNext(); // The original first node is now the tail
|
||||
tail->SetNext(nullptr); // Ensure the new tail has no next pointer
|
||||
head->SetNext(newHeadNext); // Set the head's next to the new first node
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
int TLinkedList<T>::GetSize() const {
|
||||
return size;
|
||||
}
|
||||
// --- End of TLinkedList class ---
|
||||
73
Exam/IKT203Exam/LibExample/queue.hpp
Normal file
73
Exam/IKT203Exam/LibExample/queue.hpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#pragma once
|
||||
#include <stdexcept> // For std::runtime_error
|
||||
|
||||
template <typename T, int MAX_SIZE>
|
||||
class TQueue {
|
||||
private:
|
||||
T data[MAX_SIZE]; // A static array of T with MAX_SIZE elements
|
||||
int frontIndex; // The index of the front element
|
||||
int rearIndex; // The index of the rear element
|
||||
int count; // Current number of elements in the queue
|
||||
public:
|
||||
// Constructor
|
||||
TQueue();
|
||||
// No destructor is needed since we aren't using 'new'
|
||||
// --- Core Queue Operations ---
|
||||
void Enqueue(const T& aElement);
|
||||
T Dequeue();
|
||||
T GetFront() const;
|
||||
// --- Helper Functions ---
|
||||
int size() const;
|
||||
bool IsEmpty() const;
|
||||
bool IsFull() const;
|
||||
};
|
||||
// --- Method Implementations ---
|
||||
// Constructor: Initializes the front and rear indices
|
||||
template <typename T, int MAX_SIZE>
|
||||
TQueue<T, MAX_SIZE>::TQueue() : frontIndex(0), rearIndex(-1), count(0) {
|
||||
// No memory allocation is needed
|
||||
}
|
||||
// enqueue(): Adds an element to the rear of the queue
|
||||
template <typename T, int MAX_SIZE>
|
||||
void TQueue<T, MAX_SIZE>::Enqueue(const T& aElement) {
|
||||
if (IsFull()) {
|
||||
throw std::runtime_error("Queue overflow: cannot enqueue to a full queue.");
|
||||
}
|
||||
rearIndex = (rearIndex + 1) % MAX_SIZE; // Circular increment
|
||||
data[rearIndex] = aElement;
|
||||
count++;
|
||||
}
|
||||
// dequeue(): Removes and returns the front element
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TQueue<T, MAX_SIZE>::Dequeue() {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Queue underflow: cannot dequeue from an empty queue.");
|
||||
}
|
||||
T frontElement = data[frontIndex];
|
||||
frontIndex = (frontIndex + 1) % MAX_SIZE; // Circular increment
|
||||
count--;
|
||||
return frontElement;
|
||||
}
|
||||
// getFront(): Returns the front element without removing it
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TQueue<T, MAX_SIZE>::GetFront() const {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Queue is empty: cannot get front.");
|
||||
}
|
||||
return data[frontIndex];
|
||||
}
|
||||
// size(): Returns the current number of elements
|
||||
template <typename T, int MAX_SIZE>
|
||||
int TQueue<T, MAX_SIZE>::size() const {
|
||||
return count;
|
||||
}
|
||||
// isEmpty(): Checks if the queue is empty
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TQueue<T, MAX_SIZE>::IsEmpty() const {
|
||||
return count == 0;
|
||||
}
|
||||
// isFull(): Checks if the queue is full
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TQueue<T, MAX_SIZE>::IsFull() const {
|
||||
return count == MAX_SIZE;
|
||||
}
|
||||
79
Exam/IKT203Exam/LibExample/stack.hpp
Normal file
79
Exam/IKT203Exam/LibExample/stack.hpp
Normal file
@@ -0,0 +1,79 @@
|
||||
#pragma once
|
||||
#include <stdexcept> // For std::runtime_error
|
||||
|
||||
// The template now takes a type 'T' and an integer 'MAX_SIZE'
|
||||
template <typename T, int MAX_SIZE>
|
||||
class TStack {
|
||||
private:
|
||||
T data[MAX_SIZE]; // A static array of T with MAX_SIZE elements
|
||||
int topIndex; // The index of the top element (-1 if empty)
|
||||
|
||||
public:
|
||||
// Constructor
|
||||
TStack();
|
||||
|
||||
// No destructor is needed since we aren't using 'new'
|
||||
|
||||
// --- Core Stack Operations ---
|
||||
void Push(const T& aElement);
|
||||
T Pop();
|
||||
T Peek() const;
|
||||
|
||||
// --- Helper Functions ---
|
||||
int GetSize() const;
|
||||
bool IsEmpty() const;
|
||||
bool IsFull() const;
|
||||
};
|
||||
|
||||
// --- Method Implementations ---
|
||||
|
||||
// Constructor: Just initializes the top index
|
||||
template <typename T, int MAX_SIZE>
|
||||
TStack<T, MAX_SIZE>::TStack() : topIndex(-1) {
|
||||
// No memory allocation is needed
|
||||
}
|
||||
|
||||
// push(): Adds an element to the top
|
||||
template <typename T, int MAX_SIZE>
|
||||
void TStack<T, MAX_SIZE>::Push(const T& aElement) {
|
||||
if (IsFull()) {
|
||||
throw std::runtime_error("Stack overflow: cannot push to a full stack.");
|
||||
}
|
||||
data[++topIndex] = aElement;
|
||||
}
|
||||
|
||||
// pop(): Removes and returns the top element
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TStack<T, MAX_SIZE>::Pop() {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Stack underflow: cannot pop from an empty stack.");
|
||||
}
|
||||
return data[topIndex--];
|
||||
}
|
||||
|
||||
// peek(): Returns the top element without removing it
|
||||
template <typename T, int MAX_SIZE>
|
||||
T TStack<T, MAX_SIZE>::Peek() const {
|
||||
if (IsEmpty()) {
|
||||
throw std::runtime_error("Stack is empty: cannot peek.");
|
||||
}
|
||||
return data[topIndex];
|
||||
}
|
||||
|
||||
// size(): Returns the current number of elements
|
||||
template <typename T, int MAX_SIZE>
|
||||
int TStack<T, MAX_SIZE>::GetSize() const {
|
||||
return topIndex + 1;
|
||||
}
|
||||
|
||||
// isEmpty(): Checks if the stack is empty
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TStack<T, MAX_SIZE>::IsEmpty() const {
|
||||
return topIndex == -1;
|
||||
}
|
||||
|
||||
// isFull(): Checks if the stack is full
|
||||
template <typename T, int MAX_SIZE>
|
||||
bool TStack<T, MAX_SIZE>::IsFull() const {
|
||||
return topIndex == MAX_SIZE - 1;
|
||||
}
|
||||
40
Exam/IKT203Exam/Portfolio/Assignment-01/CMakeLists.txt
Normal file
40
Exam/IKT203Exam/Portfolio/Assignment-01/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
|
||||
|
||||
# "ON" = build Option 1, "OFF" = build Option 2.
|
||||
option(BUILD_ASSIGNMENT_01_OPTION_1 "Build Assignment Option 1 (Standard)" ON)
|
||||
|
||||
add_executable(Assignment-01
|
||||
main.cpp
|
||||
)
|
||||
|
||||
# Conditionally add the correct source file
|
||||
if(BUILD_ASSIGNMENT_01_OPTION_1)
|
||||
# If ON, add option1.cpp and define 'ASSIGNMENT_OPTION=1' for C++
|
||||
target_sources(Assignment-01
|
||||
PRIVATE
|
||||
option1.cpp
|
||||
option1.h
|
||||
)
|
||||
target_compile_definitions(Assignment-01 PRIVATE "ASSIGNMENT_01_OPTION=1")
|
||||
else()
|
||||
# If OFF, add option2.cpp and define 'ASSIGNMENT_OPTION=2' for C++
|
||||
target_sources(Assignment-01
|
||||
PRIVATE
|
||||
option2.cpp
|
||||
option2.h
|
||||
)
|
||||
target_compile_definitions(Assignment-01 PRIVATE "ASSIGNMENT_01_OPTION=2")
|
||||
endif()
|
||||
target_link_libraries(Assignment-01
|
||||
PRIVATE
|
||||
SharedLib
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(TARGET Assignment-01 POST_BUILD
|
||||
# Add a custom command here if needed
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Assignment-01 post-build step"
|
||||
)
|
||||
60
Exam/IKT203Exam/Portfolio/Assignment-01/main.cpp
Normal file
60
Exam/IKT203Exam/Portfolio/Assignment-01/main.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
// Mandatory-02.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
/*
|
||||
Dear Student,
|
||||
|
||||
Remember to follow the coding standards and best practices discussed
|
||||
in the portfolio assignment document.
|
||||
Good luck with your portfolio!
|
||||
|
||||
NB: Do not delete the code below that prints the assignment and option info!
|
||||
|
||||
---------------------------------------------------------------------
|
||||
*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 ***
|
||||
---------------------------------------------------------------------
|
||||
You CANNOT switch options by changing this file.
|
||||
|
||||
1. Go to the 'CMakeLists.txt' file for this assignment.
|
||||
2. Find the line:
|
||||
option(BUILD_ASSIGNMENT_OPTION_1 "..." ON)
|
||||
3. Change 'ON' (for Option 1) to 'OFF' (for Option 2).
|
||||
|
||||
*** VERY IMPORTANT: After changing the option ***
|
||||
Your project will NOT update until you re-run the CMake configuration.
|
||||
|
||||
To force an update (e.g., in Visual Studio):
|
||||
- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'.
|
||||
- OR, simply delete the 'out' / 'build' folder and rebuild the project.
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
static constexpr std::string_view AssignmentName = "Category 1: Lists, Stacks, & Queues";
|
||||
|
||||
|
||||
#if ASSIGNMENT_01_OPTION == 1
|
||||
#include "option1.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Console Text Editor.";
|
||||
#elif ASSIGNMENT_01_OPTION == 2
|
||||
#include "option2.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Console Music Player.";
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int appStatus = 0;
|
||||
std::cout << AssignmentName << std::endl;
|
||||
std::cout << AssignmentOption << std::endl;
|
||||
|
||||
// Create only core or common code in main.cpp
|
||||
// Use the option header files to implement the specific assignment option logic
|
||||
appStatus = RunApp();
|
||||
return appStatus;
|
||||
}
|
||||
|
||||
|
||||
109
Exam/IKT203Exam/Portfolio/Assignment-01/option1.cpp
Normal file
109
Exam/IKT203Exam/Portfolio/Assignment-01/option1.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
// Option 1 (Standard): Console Text Editor.
|
||||
//
|
||||
|
||||
#include "option1.h"
|
||||
#include <iostream>
|
||||
#include "TDoublyLinkedList.h"
|
||||
#include "TQueue.h"
|
||||
#include "TStack.h"
|
||||
#include "Utils.h"
|
||||
|
||||
TDoublyLinkedList document;
|
||||
TQueue printQueue;
|
||||
TStack undoStack, redoStack;
|
||||
|
||||
bool running = true;
|
||||
int lastIndex = 0;
|
||||
std::string deletedLine;
|
||||
|
||||
void Undo()
|
||||
{
|
||||
if (!undoStack.IsEmpty()) {
|
||||
const auto action = undoStack.Pop();
|
||||
if (action.action == INSERT){
|
||||
document.Remove(action.index);
|
||||
}
|
||||
else{
|
||||
document.InsertAtIndex(action.index, action.text);
|
||||
}
|
||||
redoStack.Push(action);
|
||||
}
|
||||
}
|
||||
void Redo()
|
||||
{
|
||||
if (!redoStack.IsEmpty()) {
|
||||
const auto action = redoStack.Pop();
|
||||
if (action.action == INSERT) {
|
||||
document.InsertAtIndex(action.index, action.text);
|
||||
}
|
||||
else {
|
||||
document.Remove(action.index);
|
||||
}
|
||||
undoStack.Push(action);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int RunApp()
|
||||
{
|
||||
// Implement the Console Text Editor application logic here
|
||||
while (running) {
|
||||
switch (Utils::Choice()) {
|
||||
case 1: {
|
||||
std::cout << "----------Add line----------" << std::endl;
|
||||
lastIndex = Utils::Insert(document, undoStack, redoStack, lastIndex);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
std::cout << "----------Remove line----------" << std::endl;
|
||||
Utils::PrintList(document);
|
||||
lastIndex = Utils::RemoveLine(document, undoStack, redoStack, lastIndex);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
std::cout << "----------Current document----------" << std::endl;
|
||||
for (int i = 0; i < document.GetSize(); i++)
|
||||
std::cout << i + 1 << ". " << document.GetAtIndex(i) << std::endl;
|
||||
std::cout << "------------------------------------\n\n";
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
for (int i = 0; i < document.GetSize(); ++i)
|
||||
printQueue.Enqueue(document.GetAtIndex(i));
|
||||
|
||||
std::cout << "----------Printing queue-----------" << std::endl;
|
||||
|
||||
while (!printQueue.IsEmpty())
|
||||
std::cout << printQueue.Dequeue() << std::endl;
|
||||
std::cout << "------------------------------------\n\n";
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case 5: {
|
||||
std::cout << "----------UNDO----------" <<std::endl;
|
||||
Undo();
|
||||
break;
|
||||
}
|
||||
|
||||
case 6: {
|
||||
std::cout << "----------REDO----------" <<std::endl;
|
||||
Redo();
|
||||
break;
|
||||
}
|
||||
|
||||
case 0: {
|
||||
std::cout << "----------Exiting...----------" << std::endl;
|
||||
running = false;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
std::cout << "Invalid input, please pick a number..." << std::endl;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
11
Exam/IKT203Exam/Portfolio/Assignment-01/option1.h
Normal file
11
Exam/IKT203Exam/Portfolio/Assignment-01/option1.h
Normal file
@@ -0,0 +1,11 @@
|
||||
// option1.h : Option 1 (Standard): Console Text Editor.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION1_H
|
||||
#define OPTION1_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION1_H
|
||||
19
Exam/IKT203Exam/Portfolio/Assignment-01/option2.cpp
Normal file
19
Exam/IKT203Exam/Portfolio/Assignment-01/option2.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
// Option 2 (Advanced): Console Music Player.
|
||||
|
||||
#include <iostream>
|
||||
#include "option2.h"
|
||||
|
||||
static bool SongReadCallback(const int aIndex, const int aTotalCount, const std::string& aArtist, const std::string& aTitle, const std::string& aYear, const std::string& aGenre, const std::string& aSource) {
|
||||
// Implement the logic to process each song read from the file
|
||||
// For example, print the song details to the console
|
||||
std::cout << "Song " << (aIndex + 1) << " of " << aTotalCount << ":\n";
|
||||
std::cout << " Artist: " << aArtist << "\n";
|
||||
std::cout << " Title: " << aTitle << "\n";
|
||||
std::cout << " Year: " << aYear << "\n";
|
||||
std::cout << " Genre: " << aGenre << "\n";
|
||||
std::cout << " Source: " << aSource << "\n\n";
|
||||
// Return true to continue reading more songs
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
10
Exam/IKT203Exam/Portfolio/Assignment-01/option2.h
Normal file
10
Exam/IKT203Exam/Portfolio/Assignment-01/option2.h
Normal file
@@ -0,0 +1,10 @@
|
||||
// option1.h : Option 2 (Advanced): Console Music Player.
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION2_H
|
||||
#define OPTION2_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION2_H
|
||||
40
Exam/IKT203Exam/Portfolio/Assignment-02/CMakeLists.txt
Normal file
40
Exam/IKT203Exam/Portfolio/Assignment-02/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
|
||||
|
||||
# "ON" = build Option 1, "OFF" = build Option 2.
|
||||
option(BUILD_ASSIGNMENT_02_OPTION_1 "Build Assignment Option 1 (Standard)" ON)
|
||||
|
||||
add_executable(Assignment-02
|
||||
main.cpp
|
||||
)
|
||||
|
||||
# Conditionally add the correct source file
|
||||
if(BUILD_ASSIGNMENT_02_OPTION_1)
|
||||
# If ON, add option1.cpp and define 'ASSIGNMENT_OPTION=1' for C++
|
||||
target_sources(Assignment-02
|
||||
PRIVATE
|
||||
option1.cpp
|
||||
option1.h
|
||||
)
|
||||
target_compile_definitions(Assignment-02 PRIVATE "ASSIGNMENT_02_OPTION=1")
|
||||
else()
|
||||
# If OFF, add option2.cpp and define 'ASSIGNMENT_OPTION=2' for C++
|
||||
target_sources(Assignment-02
|
||||
PRIVATE
|
||||
option2.cpp
|
||||
option2.h
|
||||
)
|
||||
target_compile_definitions(Assignment-02 PRIVATE "ASSIGNMENT_02_OPTION=2")
|
||||
endif()
|
||||
target_link_libraries(Assignment-02
|
||||
PRIVATE
|
||||
SharedLib
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(TARGET Assignment-02 POST_BUILD
|
||||
# Add a custom command here if needed
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Assignment-02 post-build step"
|
||||
)
|
||||
57
Exam/IKT203Exam/Portfolio/Assignment-02/main.cpp
Normal file
57
Exam/IKT203Exam/Portfolio/Assignment-02/main.cpp
Normal file
@@ -0,0 +1,57 @@
|
||||
// Mandatory-02.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
/*
|
||||
Dear Student,
|
||||
|
||||
Remember to follow the coding standards and best practices discussed
|
||||
in the portfolio assignment document.
|
||||
Good luck with your portfolio!
|
||||
|
||||
NB: Do not delete the code below that prints the assignment and option info!
|
||||
|
||||
---------------------------------------------------------------------
|
||||
*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 ***
|
||||
---------------------------------------------------------------------
|
||||
You CANNOT switch options by changing this file.
|
||||
|
||||
1. Go to the 'CMakeLists.txt' file for this assignment.
|
||||
2. Find the line:
|
||||
option(BUILD_ASSIGNMENT_OPTION_1 "..." ON)
|
||||
3. Change 'ON' (for Option 1) to 'OFF' (for Option 2).
|
||||
|
||||
*** VERY IMPORTANT: After changing the option ***
|
||||
Your project will NOT update until you re-run the CMake configuration.
|
||||
|
||||
To force an update (e.g., in Visual Studio):
|
||||
- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'.
|
||||
- OR, simply delete the 'out' / 'build' folder and rebuild the project.
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
static constexpr std::string_view AssignmentName = "Category 2: Sorting & Searching";
|
||||
|
||||
#if ASSIGNMENT_02_OPTION == 1
|
||||
#include "option1.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Cruise Ship Manifest.";
|
||||
#elif ASSIGNMENT_02_OPTION == 2
|
||||
#include "option2.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Combined Corporate Directory.";
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int appStatus = 0;
|
||||
std::cout << AssignmentName << std::endl;
|
||||
std::cout << AssignmentOption << std::endl;
|
||||
|
||||
// Create only core or common code in main.cpp
|
||||
// Use the option header files to implement the specific assignment option logic
|
||||
appStatus = RunApp();
|
||||
return appStatus;
|
||||
}
|
||||
36
Exam/IKT203Exam/Portfolio/Assignment-02/option1.cpp
Normal file
36
Exam/IKT203Exam/Portfolio/Assignment-02/option1.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
// Option 1 (Standard): Console Text Editor.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include "option1.h"
|
||||
#include "SharedLib.h"
|
||||
|
||||
/**
|
||||
* @brief Callback function to process one name.
|
||||
*/
|
||||
static bool NameReadCallback(const int aIndex, const int aTotalCount, const std::string& aFirstName, const std::string& aLastName)
|
||||
{
|
||||
std::cout << "Reading Name " << (aIndex + 1) << " of " << aTotalCount << ": "
|
||||
<< aFirstName << " " << aLastName << "\n";
|
||||
|
||||
// We only want to read 10 names (index 0 through 9)
|
||||
// Return false when aIndex is 9 to stop the loop after this one.
|
||||
return (aIndex < 9);
|
||||
}
|
||||
|
||||
|
||||
int RunApp()
|
||||
{
|
||||
// Path to the names data file
|
||||
std::string filename = "F:\\IKT203\\VisualStudio\\DATA\\random_names.txt";
|
||||
|
||||
std::cout << "Reading first 10 names from file: " << filename << "\n\n";
|
||||
|
||||
// Call the utility function with the name callback
|
||||
readNamesFromFile(filename, NameReadCallback);
|
||||
|
||||
std::cout << "\nFinished reading names." << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
11
Exam/IKT203Exam/Portfolio/Assignment-02/option1.h
Normal file
11
Exam/IKT203Exam/Portfolio/Assignment-02/option1.h
Normal file
@@ -0,0 +1,11 @@
|
||||
// option1.h : Option 1 (Standard): Console Text Editor.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION1_H
|
||||
#define OPTION1_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION1_H
|
||||
8
Exam/IKT203Exam/Portfolio/Assignment-02/option2.cpp
Normal file
8
Exam/IKT203Exam/Portfolio/Assignment-02/option2.cpp
Normal file
@@ -0,0 +1,8 @@
|
||||
// Option 2 (Advanced): Console Music Player.
|
||||
|
||||
#include "option2.h"
|
||||
|
||||
int RunApp() {
|
||||
// Implement the Console Music Player application logic here
|
||||
return 0;
|
||||
}
|
||||
10
Exam/IKT203Exam/Portfolio/Assignment-02/option2.h
Normal file
10
Exam/IKT203Exam/Portfolio/Assignment-02/option2.h
Normal file
@@ -0,0 +1,10 @@
|
||||
// option1.h : Option 2 (Advanced): Console Music Player.
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION2_H
|
||||
#define OPTION2_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION2_H
|
||||
39
Exam/IKT203Exam/Portfolio/Assignment-03/CMakeLists.txt
Normal file
39
Exam/IKT203Exam/Portfolio/Assignment-03/CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
|
||||
# "ON" = build Option 1, "OFF" = build Option 2.
|
||||
option(BUILD_ASSIGNMENT_03_OPTION_1 "Build Assignment Option 1 (Standard)" ON)
|
||||
|
||||
add_executable(Assignment-03
|
||||
main.cpp
|
||||
)
|
||||
|
||||
# Conditionally add the correct source file
|
||||
if(BUILD_ASSIGNMENT_03_OPTION_1)
|
||||
# If ON, add option1.cpp and define 'ASSIGNMENT_OPTION=1' for C++
|
||||
target_sources(Assignment-03
|
||||
PRIVATE
|
||||
option1.cpp
|
||||
option1.h
|
||||
)
|
||||
target_compile_definitions(Assignment-03 PRIVATE "ASSIGNMENT_03_OPTION=1")
|
||||
else()
|
||||
# If OFF, add option2.cpp and define 'ASSIGNMENT_OPTION=2' for C++
|
||||
target_sources(Assignment-03
|
||||
PRIVATE
|
||||
option2.cpp
|
||||
option2.h
|
||||
)
|
||||
target_compile_definitions(Assignment-03 PRIVATE "ASSIGNMENT_03_OPTION=2")
|
||||
endif()
|
||||
target_link_libraries(Assignment-03
|
||||
PRIVATE
|
||||
SharedLib
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(TARGET Assignment-03 POST_BUILD
|
||||
# Add a custom command here if needed
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Assignment-03 post-build step"
|
||||
)
|
||||
54
Exam/IKT203Exam/Portfolio/Assignment-03/main.cpp
Normal file
54
Exam/IKT203Exam/Portfolio/Assignment-03/main.cpp
Normal file
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
Dear Student,
|
||||
|
||||
Remember to follow the coding standards and best practices discussed
|
||||
in the portfolio assignment document.
|
||||
Good luck with your portfolio!
|
||||
|
||||
NB: Do not delete the code below that prints the assignment and option info!
|
||||
|
||||
---------------------------------------------------------------------
|
||||
*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 ***
|
||||
---------------------------------------------------------------------
|
||||
You CANNOT switch options by changing this file.
|
||||
|
||||
1. Go to the 'CMakeLists.txt' file for this assignment.
|
||||
2. Find the line:
|
||||
option(BUILD_ASSIGNMENT_OPTION_1 "..." ON)
|
||||
3. Change 'ON' (for Option 1) to 'OFF' (for Option 2).
|
||||
|
||||
*** VERY IMPORTANT: After changing the option ***
|
||||
Your project will NOT update until you re-run the CMake configuration.
|
||||
|
||||
To force an update (e.g., in Visual Studio):
|
||||
- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'.
|
||||
- OR, simply delete the 'out' / 'build' folder and rebuild the project.
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
static constexpr std::string_view AssignmentName = "Category 3: Trees (BST, AVL & RBT)";
|
||||
|
||||
#if ASSIGNMENT_03_OPTION == 1
|
||||
#include "option1.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Employee Directory (BST vs. AVL).";
|
||||
#elif ASSIGNMENT_03_OPTION == 2
|
||||
#include "option2.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Interpreted Calculator.";
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int appStatus = 0;
|
||||
std::cout << AssignmentName << std::endl;
|
||||
std::cout << AssignmentOption << std::endl;
|
||||
|
||||
// Create only core or common code in main.cpp
|
||||
// Use the option header files to implement the specific assignment option logic
|
||||
appStatus = RunApp();
|
||||
return appStatus;
|
||||
}
|
||||
6
Exam/IKT203Exam/Portfolio/Assignment-03/option1.cpp
Normal file
6
Exam/IKT203Exam/Portfolio/Assignment-03/option1.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "option1.h"
|
||||
|
||||
int RunApp() {
|
||||
// Implement the Console Text Editor application logic here
|
||||
return 0;
|
||||
}
|
||||
9
Exam/IKT203Exam/Portfolio/Assignment-03/option1.h
Normal file
9
Exam/IKT203Exam/Portfolio/Assignment-03/option1.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION1_H
|
||||
#define OPTION1_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION1_H
|
||||
6
Exam/IKT203Exam/Portfolio/Assignment-03/option2.cpp
Normal file
6
Exam/IKT203Exam/Portfolio/Assignment-03/option2.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "option2.h"
|
||||
|
||||
int RunApp() {
|
||||
// Implement the Console Music Player application logic here
|
||||
return 0;
|
||||
}
|
||||
9
Exam/IKT203Exam/Portfolio/Assignment-03/option2.h
Normal file
9
Exam/IKT203Exam/Portfolio/Assignment-03/option2.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION2_H
|
||||
#define OPTION2_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION2_H
|
||||
37
Exam/IKT203Exam/Portfolio/Assignment-04/CMakeLists.txt
Normal file
37
Exam/IKT203Exam/Portfolio/Assignment-04/CMakeLists.txt
Normal file
@@ -0,0 +1,37 @@
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
|
||||
# "ON" = build Option 1, "OFF" = build Option 2.
|
||||
option(BUILD_ASSIGNMENT_04_OPTION_1 "Build Assignment Option 1 (Standard)" OFF)
|
||||
|
||||
add_executable(Assignment-04
|
||||
main.cpp
|
||||
)
|
||||
|
||||
if(BUILD_ASSIGNMENT_04_OPTION_1)
|
||||
target_sources(Assignment-04
|
||||
PRIVATE
|
||||
option1.cpp
|
||||
option1.h
|
||||
)
|
||||
target_compile_definitions(Assignment-04 PRIVATE "ASSIGNMENT_04_OPTION=1")
|
||||
else()
|
||||
target_sources(Assignment-04
|
||||
PRIVATE
|
||||
option2.cpp
|
||||
option2.h
|
||||
)
|
||||
target_compile_definitions(Assignment-04 PRIVATE "ASSIGNMENT_04_OPTION=2")
|
||||
endif()
|
||||
|
||||
target_link_libraries(Assignment-04
|
||||
PRIVATE
|
||||
SharedLib
|
||||
)
|
||||
|
||||
|
||||
add_custom_command(TARGET Assignment-04 POST_BUILD
|
||||
# Add a custom command here if needed
|
||||
COMMAND ${CMAKE_COMMAND} -E echo "Assignment-04 post-build step"
|
||||
)
|
||||
53
Exam/IKT203Exam/Portfolio/Assignment-04/main.cpp
Normal file
53
Exam/IKT203Exam/Portfolio/Assignment-04/main.cpp
Normal file
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
Dear Student,
|
||||
|
||||
Remember to follow the coding standards and best practices discussed
|
||||
in the portfolio assignment document.
|
||||
Good luck with your portfolio!
|
||||
|
||||
NB: Do not delete the code below that prints the assignment and option info!
|
||||
|
||||
---------------------------------------------------------------------
|
||||
*** HOW TO SWITCH BETWEEN OPTION 1 AND OPTION 2 ***
|
||||
---------------------------------------------------------------------
|
||||
You CANNOT switch options by changing this file.
|
||||
|
||||
1. Go to the 'CMakeLists.txt' file for this assignment.
|
||||
2. Find the line:
|
||||
option(BUILD_ASSIGNMENT_OPTION_1 "..." ON)
|
||||
3. Change 'ON' (for Option 1) to 'OFF' (for Option 2).
|
||||
|
||||
*** VERY IMPORTANT: After changing the option ***
|
||||
Your project will NOT update until you re-run the CMake configuration.
|
||||
|
||||
To force an update (e.g., in Visual Studio):
|
||||
- Right-click the 'CMakeLists.txt' file and select 'Configure Cache'.
|
||||
- OR, simply delete the 'out' / 'build' folder and rebuild the project.
|
||||
---------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
static constexpr std::string_view AssignmentName = "Category 4: Graphs & Dijkstra's Algorithm";
|
||||
|
||||
#if ASSIGNMENT_04_OPTION == 1
|
||||
static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Data Center Network Monitor.";
|
||||
#include "option1.h"
|
||||
#elif ASSIGNMENT_04_OPTION == 2
|
||||
static constexpr std::string_view AssignmentOption = "Option 2 (Advanced): Inter-city Logistics Router.";
|
||||
#include "option2.h"
|
||||
#endif
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
int appStatus = 0;
|
||||
std::cout << AssignmentName << std::endl;
|
||||
std::cout << AssignmentOption << std::endl;
|
||||
|
||||
|
||||
// Create only core or common code in main.cpp
|
||||
// Use the option header files to implement the specific assignment option logic
|
||||
appStatus = RunApp();
|
||||
return appStatus;
|
||||
}
|
||||
6
Exam/IKT203Exam/Portfolio/Assignment-04/option1.cpp
Normal file
6
Exam/IKT203Exam/Portfolio/Assignment-04/option1.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include "option1.h"
|
||||
#include <iostream>
|
||||
|
||||
int RunApp() {
|
||||
return 0;
|
||||
}
|
||||
9
Exam/IKT203Exam/Portfolio/Assignment-04/option1.h
Normal file
9
Exam/IKT203Exam/Portfolio/Assignment-04/option1.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION1_H
|
||||
#define OPTION1_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION1_H
|
||||
47
Exam/IKT203Exam/Portfolio/Assignment-04/option2.cpp
Normal file
47
Exam/IKT203Exam/Portfolio/Assignment-04/option2.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include <iostream>
|
||||
#include "option1.h"
|
||||
#include "SharedLib.h"
|
||||
static constexpr std::string_view AssignmentOption = "Option 1 (Standard): Data Center Network Monitor.";
|
||||
|
||||
|
||||
/**
|
||||
* @brief Callback function to process one node.
|
||||
*/
|
||||
static bool NodeReadCallback(const int aIndex, const int aTotalCount, const std::string& aNode)
|
||||
{
|
||||
std::cout << "Loading Node " << (aIndex + 1) << " of " << aTotalCount << ": " << aNode << "\n";
|
||||
|
||||
// Return true to continue reading
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Callback function to process one edge.
|
||||
*/
|
||||
static bool EdgeReadCallback(const int aIndex, const int aTotalCount, const std::string& aFromNode, const std::string& aToNode, float aWeight)
|
||||
{
|
||||
std::cout << " Loading Edge " << (aIndex + 1) << " of " << aTotalCount << ": "
|
||||
<< aFromNode << " -> " << aToNode << " (Weight: " << aWeight << ")\n";
|
||||
|
||||
// Return true to continue reading
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
int RunApp()
|
||||
{
|
||||
|
||||
std::cout << AssignmentOption << std::endl;
|
||||
|
||||
// Path to the graph data file
|
||||
std::string filename = "F:\\IKT203\\VisualStudio\\DATA\\city_graph.txt";
|
||||
|
||||
std::cout << "Reading graph from file: " << filename << "\n\n";
|
||||
|
||||
// Call the utility function with both callbacks
|
||||
readGraphFromFile(filename, NodeReadCallback, EdgeReadCallback);
|
||||
|
||||
std::cout << "\nFinished reading graph." << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
9
Exam/IKT203Exam/Portfolio/Assignment-04/option2.h
Normal file
9
Exam/IKT203Exam/Portfolio/Assignment-04/option2.h
Normal file
@@ -0,0 +1,9 @@
|
||||
#pragma once
|
||||
|
||||
#ifndef OPTION2_H
|
||||
#define OPTION2_H
|
||||
|
||||
int RunApp();
|
||||
|
||||
|
||||
#endif // OPTION2_H
|
||||
20
Exam/IKT203Exam/Portfolio/CMakeLists.txt
Normal file
20
Exam/IKT203Exam/Portfolio/CMakeLists.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# CMakeList.txt : Top-level CMake project file, do global configuration
|
||||
# and include sub-projects here.
|
||||
#
|
||||
cmake_minimum_required (VERSION 3.20)
|
||||
project ("Portfolio")
|
||||
|
||||
# Enable Hot Reload for MSVC compilers if supported.
|
||||
if (POLICY CMP0141)
|
||||
cmake_policy(SET CMP0141 NEW)
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
|
||||
endif()
|
||||
|
||||
# Include sub-projects.
|
||||
add_subdirectory(SharedLib)
|
||||
# Tell CMake to find and include the first exercise project.
|
||||
add_subdirectory(Assignment-01)
|
||||
add_subdirectory(Assignment-02)
|
||||
add_subdirectory(Assignment-03)
|
||||
add_subdirectory(Assignment-04)
|
||||
|
||||
BIN
Exam/IKT203Exam/Portfolio/IKT203_ Final Portfolio Assignment.pdf
Normal file
BIN
Exam/IKT203Exam/Portfolio/IKT203_ Final Portfolio Assignment.pdf
Normal file
Binary file not shown.
39
Exam/IKT203Exam/Portfolio/SharedLib/CMakeLists.txt
Normal file
39
Exam/IKT203Exam/Portfolio/SharedLib/CMakeLists.txt
Normal file
@@ -0,0 +1,39 @@
|
||||
# --- Step 1: Create the Library ---
|
||||
|
||||
# Define a library target named "SharedLib".
|
||||
# We use STATIC because we are using cpp and header files.
|
||||
add_library(SharedLib STATIC)
|
||||
|
||||
# --- Step 2: Add Header Files to the Library ---
|
||||
|
||||
# This command explicitly lists the header files that belong to the library.
|
||||
# This helps Visual Studio display them nicely in the Solution Explorer.
|
||||
target_sources(SharedLib
|
||||
PUBLIC
|
||||
# You can add more functionalty to SharedLib.h just by adding more definitions in SharedLib.h.
|
||||
SharedLib.h
|
||||
TDoublyLinkedList.h
|
||||
TStack.h
|
||||
TQueue.h
|
||||
Utils.h
|
||||
# Or add other shared files here
|
||||
PRIVATE
|
||||
ReadNames.cpp
|
||||
ReadGraph.cpp
|
||||
ReadSongs.cpp
|
||||
FileReaderUtils.cpp
|
||||
TDoublyLinkedList.cpp
|
||||
TStack.cpp
|
||||
TQueue.cpp
|
||||
Utils.cpp
|
||||
)
|
||||
|
||||
# --- Step 3: Make Headers "Findable" ---
|
||||
|
||||
# This is the most important command here.
|
||||
# It tells any other project that links to "SharedLib" to add this
|
||||
# directory (CMAKE_CURRENT_SOURCE_DIR) to its list of include paths.
|
||||
# This is what allows you to write #include "list.hpp" in your main.cpp.
|
||||
# Note: CMAKE_CURRENT_SOURCE_DIR is a built-in variable that points to the directory
|
||||
target_include_directories(SharedLib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
32
Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.cpp
Normal file
32
Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.cpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "FileReaderUtils.h"
|
||||
|
||||
#include "FileReaderUtils.h"
|
||||
|
||||
int GetRecordCount(const std::string& aHeaderLine)
|
||||
{
|
||||
size_t recordPos = aHeaderLine.find("records:=");
|
||||
if (recordPos == std::string::npos)
|
||||
{
|
||||
return 0; // No record count found
|
||||
}
|
||||
|
||||
size_t countStart = recordPos + 9; // Length of "records:="
|
||||
|
||||
// Find the end bracket ']' or a potential semicolon ';'
|
||||
size_t countEnd = aHeaderLine.find_first_of("];", countStart);
|
||||
if (countEnd == std::string::npos)
|
||||
{
|
||||
return 0; // Malformed header
|
||||
}
|
||||
|
||||
std::string countStr = aHeaderLine.substr(countStart, countEnd - countStart);
|
||||
try
|
||||
{
|
||||
// stoi = string to integer
|
||||
return std::stoi(countStr);
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
return 0; // Malformed number
|
||||
}
|
||||
}
|
||||
13
Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.h
Normal file
13
Exam/IKT203Exam/Portfolio/SharedLib/FileReaderUtils.h
Normal file
@@ -0,0 +1,13 @@
|
||||
// FileReaderUtils.h
|
||||
#pragma once
|
||||
#if !defined(FILEREADERUTILS_H)
|
||||
#define FILEREADERUTILS_H
|
||||
#include <string>
|
||||
/**
|
||||
* @brief [Internal] Safely parses the "records:=N" part of a header line.
|
||||
* @param aHeaderLine The line, e.g., "[NODES;records:=11]"
|
||||
* @return The number of records, or 0 if not found.
|
||||
*/
|
||||
int GetRecordCount(const std::string& aHeaderLine);
|
||||
|
||||
#endif // FILEREADERUTILS_H
|
||||
109
Exam/IKT203Exam/Portfolio/SharedLib/ReadGraph.cpp
Normal file
109
Exam/IKT203Exam/Portfolio/SharedLib/ReadGraph.cpp
Normal file
@@ -0,0 +1,109 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "SharedLib.h"
|
||||
#include "FileReaderUtils.h"
|
||||
|
||||
// --- Enum for the parser's state ---
|
||||
enum class EParseState
|
||||
{
|
||||
NONE,
|
||||
NODES,
|
||||
EDGES
|
||||
};
|
||||
|
||||
void readGraphFromFile(const std::string& aFilename, FNodeRead aOnNodeRead, FEdgeRead aOnEdgeRead)
|
||||
{
|
||||
if (aFilename.empty()) return;
|
||||
|
||||
std::ifstream file(aFilename);
|
||||
if (!file.is_open())
|
||||
{
|
||||
// Optional: print an error
|
||||
// std::cerr << "Error: Could not open file " << aFilename << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string line;
|
||||
EParseState currentState = EParseState::NONE;
|
||||
int totalCount = 0;
|
||||
int currentIndex = 0;
|
||||
bool keepReading = true;
|
||||
|
||||
while (keepReading && std::getline(file, line))
|
||||
{
|
||||
if (line.empty()) continue;
|
||||
|
||||
if (line[0] == '[')
|
||||
{
|
||||
// --- 2. USE THE SHARED FUNCTION ---
|
||||
totalCount = GetRecordCount(line);
|
||||
currentIndex = 0;
|
||||
|
||||
if (line.find("[NODES") != std::string::npos)
|
||||
{
|
||||
currentState = EParseState::NODES;
|
||||
continue;
|
||||
}
|
||||
else if (line.find("[EDGES") != std::string::npos)
|
||||
{
|
||||
currentState = EParseState::EDGES;
|
||||
continue;
|
||||
}
|
||||
// If it's a comment or other header, reset state and count
|
||||
currentState = EParseState::NONE;
|
||||
totalCount = 0;
|
||||
continue;
|
||||
}
|
||||
|
||||
// Process data based on the current state
|
||||
switch (currentState)
|
||||
{
|
||||
case EParseState::NODES:
|
||||
if (aOnNodeRead)
|
||||
{
|
||||
if (!aOnNodeRead(currentIndex, totalCount, line))
|
||||
{
|
||||
keepReading = false;
|
||||
}
|
||||
currentIndex++;
|
||||
}
|
||||
break;
|
||||
|
||||
case EParseState::EDGES:
|
||||
{
|
||||
std::istringstream edgeStream(line);
|
||||
std::string fromNode, toNode, weightStr;
|
||||
|
||||
if (std::getline(edgeStream, fromNode, ';') &&
|
||||
std::getline(edgeStream, toNode, ';') &&
|
||||
std::getline(edgeStream, weightStr))
|
||||
{
|
||||
try
|
||||
{
|
||||
// Use std::stof (string to float) for weight
|
||||
float weight = std::stof(weightStr);
|
||||
if (aOnEdgeRead)
|
||||
{
|
||||
if (!aOnEdgeRead(currentIndex, totalCount, fromNode, toNode, weight))
|
||||
{
|
||||
keepReading = false;
|
||||
}
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
catch (const std::exception&)
|
||||
{
|
||||
// Failed to parse float, skip this line
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EParseState::NONE:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
55
Exam/IKT203Exam/Portfolio/SharedLib/ReadNames.cpp
Normal file
55
Exam/IKT203Exam/Portfolio/SharedLib/ReadNames.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "SharedLib.h"
|
||||
#include "FileReaderUtils.h"
|
||||
|
||||
void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead)
|
||||
{
|
||||
if (aFilename.empty()) return;
|
||||
|
||||
std::ifstream file(aFilename);
|
||||
if (!file.is_open())
|
||||
{
|
||||
std::cerr << "Error: Could not open file " << aFilename << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string line;
|
||||
int totalCount = 0;
|
||||
int currentIndex = 0;
|
||||
bool keepReading = true;
|
||||
|
||||
// --- 1. Read the header line ---
|
||||
if (std::getline(file, line))
|
||||
{
|
||||
// Use our shared helper to get the count
|
||||
totalCount = GetRecordCount(line);
|
||||
}
|
||||
|
||||
// --- 2. Loop through the rest of the file ---
|
||||
while (keepReading && std::getline(file, line))
|
||||
{
|
||||
if (line.empty()) continue;
|
||||
|
||||
std::istringstream nameStream(line);
|
||||
std::string firstName, lastName;
|
||||
|
||||
// Parse "FirstName LastName"
|
||||
if (nameStream >> firstName >> lastName)
|
||||
{
|
||||
if (aOnNameRead)
|
||||
{
|
||||
// Call the callback with all parameters
|
||||
if (!aOnNameRead(currentIndex, totalCount, firstName, lastName))
|
||||
{
|
||||
keepReading = false;
|
||||
}
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
60
Exam/IKT203Exam/Portfolio/SharedLib/ReadSongs.cpp
Normal file
60
Exam/IKT203Exam/Portfolio/SharedLib/ReadSongs.cpp
Normal file
@@ -0,0 +1,60 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "SharedLib.h"
|
||||
#include "FileReaderUtils.h" // Include the shared utility
|
||||
|
||||
void ReadSongsFromFile(const std::string& aFilename, FSongRead aOnSongRead)
|
||||
{
|
||||
if (aFilename.empty()) return;
|
||||
|
||||
std::ifstream file(aFilename);
|
||||
if (!file.is_open())
|
||||
{
|
||||
// std::cerr << "Error: Could not open file " << aFilename << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
std::string line;
|
||||
int totalCount = 0;
|
||||
int currentIndex = 0;
|
||||
bool keepReading = true;
|
||||
|
||||
// --- 1. Read the header line ---
|
||||
if (std::getline(file, line))
|
||||
{
|
||||
// Use our shared helper to get the count
|
||||
totalCount = GetRecordCount(line);
|
||||
}
|
||||
|
||||
// --- 2. Loop through the rest of the file (the data lines) ---
|
||||
while (keepReading && std::getline(file, line))
|
||||
{
|
||||
if (line.empty()) continue; // Skip empty lines
|
||||
|
||||
std::istringstream lineStream(line);
|
||||
std::string artist, title, year, genre, source;
|
||||
|
||||
// Parse the five semicolon-separated fields
|
||||
// Artist;Title;Year;Genre;Source
|
||||
if (std::getline(lineStream, artist, ';') &&
|
||||
std::getline(lineStream, title, ';') &&
|
||||
std::getline(lineStream, year, ';') &&
|
||||
std::getline(lineStream, genre, ';') &&
|
||||
std::getline(lineStream, source)) // Last one reads to end of line
|
||||
{
|
||||
if (aOnSongRead)
|
||||
{
|
||||
// Call the callback with all parameters
|
||||
if (!aOnSongRead(currentIndex, totalCount, artist, title, year, genre, source))
|
||||
{
|
||||
keepReading = false;
|
||||
}
|
||||
currentIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file.close();
|
||||
}
|
||||
100
Exam/IKT203Exam/Portfolio/SharedLib/SharedLib.h
Normal file
100
Exam/IKT203Exam/Portfolio/SharedLib/SharedLib.h
Normal file
@@ -0,0 +1,100 @@
|
||||
#pragma once
|
||||
#ifndef SHARED_LIB_H
|
||||
#define SHARED_LIB_H
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
/// <summary>
|
||||
/// Delegate type for processing a name read from a file.
|
||||
/// </summary>
|
||||
/// <param name="aIndex">The index of the name (0-based).</param>
|
||||
/// <param name="aTotalCount">The total number of names.</param>
|
||||
/// <param name="aFirstName">The first name read from the file.</param>
|
||||
/// <param name="aLastName">The last name read from the file.</param>
|
||||
/// <returns>Returns true to continue reading, false to stop.</returns>
|
||||
typedef bool (*FNameRead)(
|
||||
const int aIndex,
|
||||
const int aTotalCount,
|
||||
const std::string& aFirstName,
|
||||
const std::string& aLastName
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Use this function to read names from a specified file and process them using a callback function.
|
||||
/// </summary>
|
||||
/// <function>readNamesFromFile</function>
|
||||
/// <description>Reads names from a specified file and invokes a callback for each name read.</description>
|
||||
/// <param name="aFilename">The path to the file containing names.</param>
|
||||
/// <param name="aOnNameRead">A callback function that is called for each name read. It takes two parameters: firstName and lastName. If the callback returns false, the reading process stops.</param>
|
||||
/// <param name="firstName">The first name read from the file.</param>
|
||||
/// <param name="lastName">The last name read from the file.</param>
|
||||
/// <returns>None.</returns>
|
||||
void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead);
|
||||
|
||||
/// <summary>
|
||||
/// Delegate type for processing a node read from the file.
|
||||
/// </summary>
|
||||
/// <description>Function pointer type for a callback that processes nodes read from a file.</description>
|
||||
/// <param name="aIndex">The index of the node (0-based).</param>
|
||||
/// <param name="aTotalCount">The total number of nodes.</param>
|
||||
/// <param name="aNode">The node std::string.</param>
|
||||
/// <returns>Returns true to continue reading, false to stop.</returns>
|
||||
typedef bool (*FNodeRead)(const int aIndex, const int aTotalCount, const std::string& aNode);
|
||||
|
||||
/// <summary>
|
||||
/// Delegate type for processing an edge read from the file.
|
||||
/// </summary>
|
||||
/// <description>Function pointer type for a callback that processes edges read from a file.</description>
|
||||
/// <param name="aIndex">The index of the edge (0-based).</param>
|
||||
/// <param name="aTotalCount">The total number of edges.</param>
|
||||
/// <param name="aFromNode">The from node std::string.</param>
|
||||
/// <param name="aToNode">The to node std::string.</param>
|
||||
/// <param name="aWeight">The weight of the edge.</param>
|
||||
/// <returns>Returns true to continue reading, false to stop.</returns>
|
||||
typedef bool (*FEdgeRead)(const int aIndex, const int aTotalCount, const std::string& aFromNode, const std::string& aToNode, float aWeight);
|
||||
|
||||
/// </summary>
|
||||
/// Use this function to read a graph from a specified file and process its nodes and edges using callback functions.
|
||||
/// </summary>
|
||||
/// <function>readGraphFromFile</function>
|
||||
/// <description>
|
||||
/// Reads a graph from a specified file and invokes callbacks for each node and edge read.
|
||||
/// All nodes are read first, followed by edges.
|
||||
/// </description>
|
||||
/// <param name="aFilename">The path to the file containing the graph data.</param>
|
||||
/// <param name="aOnNodeRead">A callback function that is called for each node read. It takes one parameter: the node std::string. If the callback returns false, the reading process stops.</param>
|
||||
/// <param name="aOnEdgeRead">A callback function that is called for each edge read. It takes three parameters: the fromNode std::string, the toNode std::string, and the weight float. If the callback returns false, the reading process stops.</param>
|
||||
void readGraphFromFile(const std::string& aFilename, FNodeRead aOnNodeRead, FEdgeRead aOnEdgeRead);
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Delegate type for processing a song read from the file.
|
||||
/// </summary>
|
||||
/// <param name="aIndex">The index of the song (0-based).</param>
|
||||
/// <param name="aTotalCount">The total number of songs.</param>
|
||||
/// <param name="aArtist">The artist.</param>
|
||||
/// <param name="aTitle">The title.</param>
|
||||
/// <param name="aYear">The release year (as a std::string).</param>
|
||||
/// <param name="aGenre">The genre.</param>
|
||||
/// <param name="aSource">The source.</param>
|
||||
/// <returns>Returns true to continue reading, false to stop.</returns>
|
||||
typedef bool (*FSongRead)(
|
||||
const int aIndex,
|
||||
const int aTotalCount,
|
||||
const std::string& aArtist,
|
||||
const std::string& aTitle,
|
||||
const std::string& aYear,
|
||||
const std::string& aGenre,
|
||||
const std::string& aSource
|
||||
);
|
||||
|
||||
/// <summary>
|
||||
/// Reads song data from a file and processes them using a callback.
|
||||
/// This function automatically skips the "records:=" header.
|
||||
/// </summary>
|
||||
/// <param name="aFilename">The path to the file (e.g., "songs.txt").</param>
|
||||
/// <param name="aOnSongRead">The callback function called for each song.</param>
|
||||
void ReadSongsFromFile(const std::string& aFilename, FSongRead aOnSongRead);
|
||||
|
||||
|
||||
#endif // SHARED_LIB_H
|
||||
114
Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.cpp
Normal file
114
Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.cpp
Normal file
@@ -0,0 +1,114 @@
|
||||
#include "TDoublyLinkedList.h"
|
||||
#include <iostream>
|
||||
#include "SharedLib.h"
|
||||
|
||||
|
||||
|
||||
void TDoublyLinkedList::Append(const std::string& line)
|
||||
{
|
||||
auto* newNode = new Node(line);
|
||||
if (size == 0)
|
||||
head = tail = newNode;
|
||||
else {
|
||||
newNode->SetPrev(tail);
|
||||
tail->SetNext(newNode);
|
||||
tail = newNode;
|
||||
}
|
||||
size++;
|
||||
}
|
||||
|
||||
void TDoublyLinkedList::Prepend(const std::string& line)
|
||||
{
|
||||
auto* newNode = new Node(line);
|
||||
if (size == 0)
|
||||
head = tail = newNode;
|
||||
else {
|
||||
newNode->SetNext(head);
|
||||
head->SetPrev(newNode);
|
||||
head = newNode;
|
||||
}
|
||||
size++;
|
||||
}
|
||||
|
||||
TDoublyLinkedList::Node* TDoublyLinkedList::NavigateToNode(const int index) const
|
||||
{
|
||||
if (index < 0 || index >= size)
|
||||
return nullptr;
|
||||
|
||||
auto* node = head;
|
||||
|
||||
for (int i = 0; i < index; i++)
|
||||
node = node->GetNext();
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
void TDoublyLinkedList::Remove(const int index)
|
||||
{
|
||||
auto* node = NavigateToNode(index);
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
if (node->GetPrev())
|
||||
node->GetPrev()->SetNext(node->GetNext());
|
||||
else
|
||||
head = node->GetNext();
|
||||
if (node->GetNext())
|
||||
node->GetNext()->SetPrev(node->GetPrev());
|
||||
else
|
||||
tail = node->GetPrev();
|
||||
|
||||
delete node;
|
||||
size--;
|
||||
}
|
||||
|
||||
std::string TDoublyLinkedList::GetAtIndex(const int index) const
|
||||
{
|
||||
const auto* node = NavigateToNode(index);
|
||||
return node ? node->GetLine() : "Error, line does not exist\n";
|
||||
}
|
||||
|
||||
void TDoublyLinkedList::InsertAtIndex(const int index, const std::string &line)
|
||||
{
|
||||
if (index < 0 || index > size) {
|
||||
std::cout << "========\nIndex doesn't exist\n========\n" << std::endl;
|
||||
return;
|
||||
}
|
||||
if (index == 0)
|
||||
{
|
||||
Prepend(line);
|
||||
return;
|
||||
}
|
||||
if (index == size)
|
||||
{
|
||||
Append(line);
|
||||
return;
|
||||
}
|
||||
Node* cur = head;
|
||||
for (int i = 0; i < index; i++)
|
||||
cur = cur->GetNext();
|
||||
Node* newNode = new Node(line);
|
||||
Node* prev = cur->GetPrev();
|
||||
|
||||
newNode->SetPrev(prev);
|
||||
newNode->SetNext(cur);
|
||||
|
||||
prev->SetNext(newNode);
|
||||
cur->SetPrev(newNode);
|
||||
|
||||
size++;
|
||||
}
|
||||
|
||||
|
||||
int TDoublyLinkedList::GetSize() const
|
||||
{
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
60
Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.h
Normal file
60
Exam/IKT203Exam/Portfolio/SharedLib/TDoublyLinkedList.h
Normal file
@@ -0,0 +1,60 @@
|
||||
#ifndef TDOUBLYLINKEDLIST_H
|
||||
#define TDOUBLYLINKEDLIST_H
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include "SharedLib.h"
|
||||
|
||||
|
||||
|
||||
class TDoublyLinkedList {
|
||||
|
||||
private:
|
||||
struct Node {
|
||||
std::string line;
|
||||
Node* next;
|
||||
Node* prev;
|
||||
explicit Node(std::string text) : line(std::move(text)), next(nullptr), prev(nullptr) {}
|
||||
|
||||
void SetNext(Node* node)
|
||||
{
|
||||
this->next = node;
|
||||
}
|
||||
void SetPrev(Node* node)
|
||||
{
|
||||
this->prev = node;
|
||||
}
|
||||
[[nodiscard]] Node* GetPrev() const
|
||||
{
|
||||
return this->prev;
|
||||
}
|
||||
[[nodiscard]] Node* GetNext() const
|
||||
{
|
||||
return this->next;
|
||||
}
|
||||
[[nodiscard]] std::string GetLine() const
|
||||
{
|
||||
return line;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Node* head;
|
||||
Node* tail;
|
||||
int size;
|
||||
|
||||
|
||||
public:
|
||||
TDoublyLinkedList() : head(nullptr), tail(nullptr), size(0) {}
|
||||
~TDoublyLinkedList() = default;
|
||||
|
||||
void Append(const std::string &line);
|
||||
void Prepend(const std::string& line);
|
||||
[[nodiscard]] Node* NavigateToNode(int index) const;
|
||||
void Remove(int index);
|
||||
[[nodiscard]] std::string GetAtIndex(int index) const;
|
||||
void InsertAtIndex(int index, const std::string &line);
|
||||
[[nodiscard]] int GetSize() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //TDOUBLYLINKEDLIST_H
|
||||
47
Exam/IKT203Exam/Portfolio/SharedLib/TQueue.cpp
Normal file
47
Exam/IKT203Exam/Portfolio/SharedLib/TQueue.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
#include "TQueue.h"
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
|
||||
void TQueue::Enqueue(const std::string& text)
|
||||
{
|
||||
if (IsFull())
|
||||
throw std::overflow_error("Queue Overflow");
|
||||
queue[tail] = text;
|
||||
tail = (tail + 1) % MAX_SIZE;
|
||||
count++;
|
||||
}
|
||||
|
||||
std::string TQueue::Dequeue()
|
||||
{
|
||||
if (IsEmpty())
|
||||
throw std::underflow_error("Empty Queue");
|
||||
const std::string item = queue[head];
|
||||
head = (head + 1) % MAX_SIZE;
|
||||
count--;
|
||||
return item;
|
||||
}
|
||||
|
||||
std::string TQueue::Peek() const
|
||||
{
|
||||
if (IsEmpty())
|
||||
throw std::underflow_error("Empty Queue");
|
||||
return queue[head];
|
||||
}
|
||||
|
||||
bool TQueue::IsEmpty() const
|
||||
{
|
||||
return count == 0;
|
||||
}
|
||||
|
||||
bool TQueue::IsFull() const
|
||||
{
|
||||
return count == MAX_SIZE;
|
||||
}
|
||||
|
||||
int TQueue::GetTail() const
|
||||
{
|
||||
if (IsEmpty())
|
||||
throw std::underflow_error("Empty Queue");
|
||||
return tail;
|
||||
}
|
||||
28
Exam/IKT203Exam/Portfolio/SharedLib/TQueue.h
Normal file
28
Exam/IKT203Exam/Portfolio/SharedLib/TQueue.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef TQUEUE_H
|
||||
#define TQUEUE_H
|
||||
#define MAX_SIZE 100
|
||||
|
||||
#include "TDoublyLinkedList.h"
|
||||
|
||||
|
||||
class TQueue {
|
||||
private:
|
||||
std::string queue[MAX_SIZE];
|
||||
int head = 0;
|
||||
int tail = 0;
|
||||
int count = 0;
|
||||
|
||||
public:
|
||||
TQueue() = default;
|
||||
~TQueue() = default;
|
||||
|
||||
void Enqueue(const std::string& text);
|
||||
std::string Dequeue();
|
||||
[[nodiscard]] int GetTail() const;
|
||||
[[nodiscard]] std::string Peek() const;
|
||||
[[nodiscard]] bool IsEmpty() const;
|
||||
[[nodiscard]] bool IsFull() const;
|
||||
};
|
||||
|
||||
|
||||
#endif //TQUEUE_H
|
||||
36
Exam/IKT203Exam/Portfolio/SharedLib/TStack.cpp
Normal file
36
Exam/IKT203Exam/Portfolio/SharedLib/TStack.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "TStack.h"
|
||||
#include <stdexcept>
|
||||
|
||||
void TStack::Push(const TAction& action)
|
||||
{
|
||||
if (top >= STACK_MAX_SIZE)
|
||||
throw std::overflow_error("Stack overflow");
|
||||
event[top++] = action;
|
||||
}
|
||||
|
||||
TStack::TAction TStack::Pop()
|
||||
{
|
||||
if (top == 0)
|
||||
throw std::underflow_error("Stack empty");
|
||||
return event[--top];
|
||||
}
|
||||
|
||||
TStack::TAction TStack::Peek() const
|
||||
{
|
||||
if (top == 0)
|
||||
throw std::underflow_error("Stack empty");
|
||||
return event[top - 1];
|
||||
}
|
||||
|
||||
bool TStack::IsEmpty() const
|
||||
{
|
||||
return top == 0;
|
||||
}
|
||||
|
||||
void TStack::Clear()
|
||||
{
|
||||
for (int i = 0; i < top; i++) {
|
||||
this->Pop();
|
||||
}
|
||||
}
|
||||
|
||||
37
Exam/IKT203Exam/Portfolio/SharedLib/TStack.h
Normal file
37
Exam/IKT203Exam/Portfolio/SharedLib/TStack.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#ifndef TSTACK_H
|
||||
#define TSTACK_H
|
||||
|
||||
#define STACK_MAX_SIZE 100
|
||||
#include <string>
|
||||
|
||||
|
||||
enum EnumActionType {
|
||||
INSERT,
|
||||
DELETE
|
||||
};
|
||||
|
||||
class TStack {
|
||||
private:
|
||||
struct TAction {
|
||||
EnumActionType action;
|
||||
std::string text;
|
||||
int index;
|
||||
};
|
||||
|
||||
TAction event[STACK_MAX_SIZE]{};
|
||||
int top = 0;
|
||||
|
||||
public:
|
||||
TStack() = default;
|
||||
~TStack() = default;
|
||||
|
||||
void Push(const TAction& action);
|
||||
TAction Pop();
|
||||
[[nodiscard]] TAction Peek() const;
|
||||
[[nodiscard]] bool IsEmpty() const;
|
||||
void Clear();
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //TSTACK_H
|
||||
78
Exam/IKT203Exam/Portfolio/SharedLib/Utils.cpp
Normal file
78
Exam/IKT203Exam/Portfolio/SharedLib/Utils.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
#include "Utils.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <limits>
|
||||
|
||||
#include "TDoublyLinkedList.h"
|
||||
#include "TStack.h"
|
||||
|
||||
|
||||
int Utils::Choice()
|
||||
{
|
||||
std::cout << "========\n1. Add line\n2. Remove line\n3. Print current document\n4. Print queue\n5. Undo\n6. Redo\n0. Exit"
|
||||
"\n\nChoice: ";
|
||||
int choice;
|
||||
std::cin >> choice;
|
||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
//std::cout << "\n=====================\n";
|
||||
return choice;
|
||||
}
|
||||
|
||||
int Utils::Insert(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index)
|
||||
{
|
||||
for (int i = 0; i < document.GetSize(); i++) {
|
||||
std::cout << i + 1 << ". " << document.GetAtIndex(i) << std::endl;
|
||||
}
|
||||
if (document.GetSize() > 0)
|
||||
{
|
||||
std::cout << "Enter the line number where you want to insert the line" <<std::endl;
|
||||
if (!(std::cin >> index)) {
|
||||
std::cin.clear();
|
||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
std::cout << "========\nIndex must be a number\n========\n\n" << std::endl;
|
||||
return index;
|
||||
}
|
||||
|
||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
}
|
||||
if (document.GetSize() < 1)
|
||||
index = 1;
|
||||
|
||||
std::cout << "Enter the text" <<std::endl;
|
||||
std::string line;
|
||||
std::getline(std::cin, line);
|
||||
|
||||
|
||||
document.InsertAtIndex(index - 1, line);
|
||||
undoStack.Push({INSERT, line, index - 1});
|
||||
if (!redoStack.IsEmpty()) {
|
||||
redoStack.Clear();
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
void Utils::PrintList(const TDoublyLinkedList &document)
|
||||
{
|
||||
for (int i = 0; i < document.GetSize(); i++) {
|
||||
std::cout << i + 1 << ". " << document.GetAtIndex(i) << std::endl;
|
||||
}
|
||||
std::cout << "\n\n";
|
||||
}
|
||||
|
||||
int Utils::RemoveLine(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index)
|
||||
{
|
||||
std::cout << "Enter the number of the line you want to remove" <<std::endl;
|
||||
if (!(std::cin >> index)) {
|
||||
std::cin.clear();
|
||||
std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
std::cout << "========\nIndex must be a number\n========\n\n" << std::endl;
|
||||
return index;
|
||||
} std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
|
||||
const std::string deletedLine = document.GetAtIndex(index-1);
|
||||
document.Remove(index-1);
|
||||
undoStack.Push({DELETE, deletedLine, index-1});
|
||||
if (!redoStack.IsEmpty()) {
|
||||
redoStack.Clear();
|
||||
}
|
||||
return index;
|
||||
}
|
||||
26
Exam/IKT203Exam/Portfolio/SharedLib/Utils.h
Normal file
26
Exam/IKT203Exam/Portfolio/SharedLib/Utils.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
#include "TDoublyLinkedList.h"
|
||||
#include "TStack.h"
|
||||
|
||||
|
||||
class Utils {
|
||||
public:
|
||||
static int Choice();
|
||||
static int Insert(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index);
|
||||
static void PrintList(const TDoublyLinkedList &document);
|
||||
static int RemoveLine(TDoublyLinkedList &document, TStack &undoStack, TStack &redoStack, int index);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif //PART1_UTILS_H
|
||||
19
Exam/IKT203Exam/Submissions/CMakeLists.txt
Normal file
19
Exam/IKT203Exam/Submissions/CMakeLists.txt
Normal file
@@ -0,0 +1,19 @@
|
||||
# CMakeList.txt : Top-level CMake project file, do global configuration
|
||||
# and include sub-projects here.
|
||||
#
|
||||
cmake_minimum_required (VERSION 3.20)
|
||||
|
||||
# Enable Hot Reload for MSVC compilers if supported.
|
||||
if (POLICY CMP0141)
|
||||
cmake_policy(SET CMP0141 NEW)
|
||||
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<AND:$<C_COMPILER_ID:MSVC>,$<CXX_COMPILER_ID:MSVC>>,$<$<CONFIG:Debug,RelWithDebInfo>:EditAndContinue>,$<$<CONFIG:Debug,RelWithDebInfo>:ProgramDatabase>>")
|
||||
endif()
|
||||
|
||||
project ("Exercises")
|
||||
|
||||
# Include sub-projects.
|
||||
add_subdirectory ("Submission-01")
|
||||
add_subdirectory ("Submission-02")
|
||||
add_subdirectory ("Submission-03")
|
||||
add_subdirectory ("Submission-04")
|
||||
add_subdirectory ("Submission-05")
|
||||
13
Exam/IKT203Exam/Submissions/Submission-01/CMakeLists.txt
Normal file
13
Exam/IKT203Exam/Submissions/Submission-01/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
# CMakeList.txt : CMake project for Submission-01, include source and define
|
||||
# project specific logic here.
|
||||
#
|
||||
|
||||
# Add source to this project's executable.
|
||||
add_executable (Submission-01 "main.cpp" "main.h")
|
||||
target_link_libraries(Submission-01 PRIVATE LibExample)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.20)
|
||||
set_property(TARGET Submission-01 PROPERTY CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
# TODO: Add tests and install targets if needed.
|
||||
309
Exam/IKT203Exam/Submissions/Submission-01/main.cpp
Normal file
309
Exam/IKT203Exam/Submissions/Submission-01/main.cpp
Normal file
@@ -0,0 +1,309 @@
|
||||
// Submission-01.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "main.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
|
||||
// Movie class with bitwise genre flags
|
||||
enum EGenreFlags {
|
||||
Action = 0x0001,
|
||||
Comedy = 0x0002,
|
||||
Drama = 0x0004,
|
||||
Horror = 0x0008,
|
||||
SciFi = 0x0010,
|
||||
Romance = 0x0020,
|
||||
Documentary = 0x0040,
|
||||
Thriller = 0x0080,
|
||||
Crime = 0x0100,
|
||||
Fantasy = 0x0200,
|
||||
Animation = 0x0400,
|
||||
Adventure = 0x0800
|
||||
};
|
||||
|
||||
static std::string GenreFlagsToString(int genreFlags) {
|
||||
std::string result;
|
||||
if (genreFlags & EGenreFlags::Action) result += "Action ";
|
||||
if (genreFlags & EGenreFlags::Comedy) result += "Comedy ";
|
||||
if (genreFlags & EGenreFlags::Drama) result += "Drama ";
|
||||
if (genreFlags & EGenreFlags::Horror) result += "Horror ";
|
||||
if (genreFlags & EGenreFlags::SciFi) result += "SciFi ";
|
||||
if (genreFlags & EGenreFlags::Romance) result += "Romance ";
|
||||
if (genreFlags & EGenreFlags::Documentary) result += "Documentary ";
|
||||
if (genreFlags & EGenreFlags::Thriller) result += "Thriller ";
|
||||
if (genreFlags & EGenreFlags::Crime) result += "Crime ";
|
||||
if (genreFlags & EGenreFlags::Fantasy) result += "Fantasy ";
|
||||
if (genreFlags & EGenreFlags::Animation) result += "Animation ";
|
||||
if (genreFlags & EGenreFlags::Adventure) result += "Adventure ";
|
||||
return result.empty() ? "None" : result;
|
||||
}
|
||||
|
||||
// Movie class definition
|
||||
class TMovie {
|
||||
private:
|
||||
std::string title;
|
||||
std::string director;
|
||||
int year;
|
||||
int genreFlags; // Bitwise combination of EGenreFlags
|
||||
float rating; // Scale from 0.0 to 10.0
|
||||
|
||||
public:
|
||||
TMovie(std::string t, std::string d, int y, int g, float r)
|
||||
: title(t), director(d), year(y), genreFlags(g), rating(r) {}
|
||||
void PrintInfo() const {
|
||||
std::cout << "Title: " << title << "\nDirector: " << director
|
||||
<< "\nYear: " << year << "\nGenres: " << GenreFlagsToString(genreFlags)
|
||||
<< "\nRating: " << rating << "/10\n";
|
||||
}
|
||||
std::string GetTitle() const { return title; }
|
||||
std::string GetDirector() const { return director; }
|
||||
int GetYear() const { return year; }
|
||||
float GetRating() const { return rating; }
|
||||
int GetGenreFlags() const { return genreFlags; }
|
||||
bool HasGenre(EGenreFlags genre) const {
|
||||
return (genreFlags & genre) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
typedef bool (*FCheckMovie)(TMovie*, void*);
|
||||
typedef void (*FMovieIndex)(TMovie*, int);
|
||||
|
||||
// Doubly Linked List TMovieNode definition
|
||||
struct TMovieNode {
|
||||
TMovie* movie;
|
||||
TMovieNode* next;
|
||||
TMovieNode* prev;
|
||||
TMovieNode(TMovie* m) : movie(m), next(nullptr), prev(nullptr) {}
|
||||
};
|
||||
|
||||
// Doubly Linked List class definition with dummy node, head, and tail O(1) operations
|
||||
class TMovieList {
|
||||
private:
|
||||
TMovieNode* head; // Always points to dummy node
|
||||
TMovieNode* tail;
|
||||
int size;
|
||||
|
||||
// Helper function to get node at index
|
||||
TMovieNode* InternalGetAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= size) return nullptr;
|
||||
TMovieNode* current;
|
||||
// Optimize traversal direction, if index is in the first half, start from head, else from tail
|
||||
if (aIndex < size / 2) {
|
||||
current = head->next; // Start from the beginning
|
||||
for (int i = 0; i < aIndex; i++) {
|
||||
current = current->next;
|
||||
}
|
||||
}
|
||||
else {
|
||||
current = tail; // Start from the end
|
||||
for (int i = size - 1; i > aIndex; i--) {
|
||||
current = current->prev;
|
||||
}
|
||||
}
|
||||
return current;
|
||||
}
|
||||
|
||||
public:
|
||||
TMovieList() {
|
||||
head = new TMovieNode(nullptr); // Dummy node
|
||||
tail = head; // Initially, tail is the same as head
|
||||
size = 0;
|
||||
}
|
||||
~TMovieList() {
|
||||
Clear();
|
||||
delete head; // Delete dummy node
|
||||
}
|
||||
void Clear() {
|
||||
TMovieNode* current = head->next; // Start from the first real node
|
||||
while (current) {
|
||||
TMovieNode* toDelete = current;
|
||||
current = current->next;
|
||||
delete toDelete->movie;
|
||||
delete toDelete;
|
||||
}
|
||||
head->next = nullptr;
|
||||
tail = head; // Reset tail to dummy node
|
||||
size = 0;
|
||||
}
|
||||
|
||||
// Insertion at the end O(1)
|
||||
void Append(TMovie* aMovie) {
|
||||
TMovieNode* newNode = new TMovieNode(aMovie);
|
||||
newNode->prev = tail;
|
||||
tail->next = newNode;
|
||||
tail = newNode;
|
||||
size++;
|
||||
}
|
||||
|
||||
// Prepend at the beginning O(1)
|
||||
void Prepend(TMovie* aMovie) {
|
||||
TMovieNode* newNode = new TMovieNode(aMovie);
|
||||
newNode->next = head->next;
|
||||
newNode->prev = head;
|
||||
if (head->next) {
|
||||
head->next->prev = newNode;
|
||||
} else {
|
||||
tail = newNode; // If list was empty, update tail
|
||||
}
|
||||
head->next = newNode;
|
||||
size++;
|
||||
}
|
||||
|
||||
// GetAtIndex O(n) check direction to optimize
|
||||
TMovie* GetAtIndex(int aIndex) {
|
||||
return InternalGetAtIndex(aIndex)->movie;
|
||||
}
|
||||
|
||||
// Remove at index O(n) use GetAtIndex to find node
|
||||
bool RemoveAtIndex(int aIndex) {
|
||||
if (aIndex < 0 || aIndex >= size) return false;
|
||||
TMovieNode* toDelte = InternalGetAtIndex(aIndex);
|
||||
if (!toDelte) return false;
|
||||
if (toDelte->prev) {
|
||||
toDelte->prev->next = toDelte->next;
|
||||
}
|
||||
if (toDelte->next) {
|
||||
toDelte->next->prev = toDelte->prev;
|
||||
} else {
|
||||
tail = toDelte->prev; // Update tail if last node is removed
|
||||
}
|
||||
delete toDelte->movie;
|
||||
delete toDelte;
|
||||
size--;
|
||||
return true;
|
||||
}
|
||||
|
||||
// Reverse the list O(n)
|
||||
void Reverse() {
|
||||
TMovieNode* current = head->next;
|
||||
TMovieNode* prev = nullptr;
|
||||
tail = head->next;
|
||||
while (current) {
|
||||
TMovieNode* nextNode = current->next;
|
||||
current->next = prev;
|
||||
current->prev = nextNode;
|
||||
prev = current;
|
||||
current = nextNode;
|
||||
}
|
||||
head->next = prev;
|
||||
if (prev) {
|
||||
prev->prev = head;
|
||||
}
|
||||
}
|
||||
|
||||
// SearchFor O(n)
|
||||
TMovie* SearchFor(FCheckMovie aCheckFunc, void* aUserData) {
|
||||
TMovieNode* current = head->next;
|
||||
while (current) {
|
||||
if (aCheckFunc(current->movie, aUserData)) {
|
||||
return current->movie;
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Every movie in the list O(n)
|
||||
void Every(FMovieIndex aIndexFunc) {
|
||||
TMovieNode* current = head->next;
|
||||
int index = 0;
|
||||
while (current) {
|
||||
aIndexFunc(current->movie, index);
|
||||
current = current->next;
|
||||
index++;
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
using namespace std;
|
||||
|
||||
static void PrintNode(std::string* data, int index) {
|
||||
cout << "Node " << index << ": " << *data << endl;
|
||||
}
|
||||
|
||||
static bool CheckMovieByTitle(TMovie* movie, void* title) {
|
||||
return movie->GetTitle() == *(static_cast<std::string*>(title));
|
||||
}
|
||||
|
||||
static bool CheckMovieByDirector(TMovie* movie, void* director) {
|
||||
return movie->GetDirector() == *(static_cast<std::string*>(director));
|
||||
}
|
||||
|
||||
static bool FindAllMovieByGenre(TMovie* movie, void* genre) {
|
||||
if(movie->HasGenre(*(static_cast<EGenreFlags*>(genre)))) {
|
||||
movie->PrintInfo();
|
||||
std::cout << "-------------------" << std::endl;
|
||||
}
|
||||
// Always return false to continue searching
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
|
||||
std::cout << "--- Submission 1: Linked List ---" << std::endl;
|
||||
|
||||
// Create a movie list
|
||||
TMovieList movieList;
|
||||
// Add some movies
|
||||
movieList.Append(new TMovie("Inception", "Christopher Nolan", 2010, EGenreFlags::Action | EGenreFlags::SciFi, 8.8f));
|
||||
movieList.Append(new TMovie("The Godfather", "Francis Ford Coppola", 1972, EGenreFlags::Crime | EGenreFlags::Drama, 9.2f));
|
||||
movieList.Prepend(new TMovie("Toy Story", "John Lasseter", 1995, EGenreFlags::Animation | EGenreFlags::Adventure | EGenreFlags::Comedy, 8.3f));
|
||||
movieList.Append(new TMovie("The Dark Knight", "Christopher Nolan", 2008, EGenreFlags::Action | EGenreFlags::Crime | EGenreFlags::Drama, 9.0f));
|
||||
// Print movie info
|
||||
for (int i = 0; i < 3; i++) {
|
||||
TMovie* movie = movieList.GetAtIndex(i);
|
||||
if (movie) {
|
||||
movie->PrintInfo();
|
||||
std::cout << "-------------------" << std::endl;
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
// Wait for user input to proceed
|
||||
std::cout << "Press Enter to continue..." << std::endl;
|
||||
std::cin.get();
|
||||
|
||||
// Search for a movie by title
|
||||
std::string searchTitle = "Inception";
|
||||
TMovie* foundMovie = movieList.SearchFor(CheckMovieByTitle, &searchTitle);
|
||||
if (foundMovie) {
|
||||
std::cout << "Found movie by title '" << searchTitle << "':" << std::endl;
|
||||
foundMovie->PrintInfo();
|
||||
} else {
|
||||
std::cout << "Movie with title '" << searchTitle << "' not found." << std::endl;
|
||||
}
|
||||
std::cout << "-------------------" << std::endl;
|
||||
std::cout << std::endl;
|
||||
|
||||
// Search for a movie by director
|
||||
std::string searchDirector = "John Lasseter";
|
||||
foundMovie = movieList.SearchFor(CheckMovieByDirector, &searchDirector);
|
||||
if (foundMovie) {
|
||||
std::cout << "Found movie by director '" << searchDirector << "':" << std::endl;
|
||||
foundMovie->PrintInfo();
|
||||
} else {
|
||||
std::cout << "Movie with director '" << searchDirector << "' not found." << std::endl;
|
||||
}
|
||||
std::cout << "-------------------" << std::endl;
|
||||
std::cout << std::endl;
|
||||
|
||||
// Find all movies in the Action genre
|
||||
EGenreFlags searchGenre = EGenreFlags::Action;
|
||||
std::cout << "Movies in the Action genre:" << std::endl;
|
||||
movieList.SearchFor(FindAllMovieByGenre, &searchGenre);
|
||||
std::cout << std::endl;
|
||||
|
||||
// Reverse the list
|
||||
movieList.Reverse();
|
||||
std::cout << "Movies after reversing the list:" << std::endl;
|
||||
movieList.Every([](TMovie* movie, int index) {
|
||||
std::cout << "Index " << index << ":" << std::endl;
|
||||
movie->PrintInfo();
|
||||
std::cout << "-------------------" << std::endl;
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
8
Exam/IKT203Exam/Submissions/Submission-01/main.h
Normal file
8
Exam/IKT203Exam/Submissions/Submission-01/main.h
Normal file
@@ -0,0 +1,8 @@
|
||||
// Submission-01.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: Reference additional headers your program requires here.
|
||||
13
Exam/IKT203Exam/Submissions/Submission-02/CMakeLists.txt
Normal file
13
Exam/IKT203Exam/Submissions/Submission-02/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
# CMakeList.txt : CMake project for Submission-01, include source and define
|
||||
# project specific logic here.
|
||||
#
|
||||
|
||||
# Add source to this project's executable.
|
||||
add_executable (Submission-02 "main.cpp" "main.h")
|
||||
target_link_libraries(Submission-02 PRIVATE LibExample)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.20)
|
||||
set_property(TARGET Submission-02 PROPERTY CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
# TODO: Add tests and install targets if needed.
|
||||
121
Exam/IKT203Exam/Submissions/Submission-02/main.cpp
Normal file
121
Exam/IKT203Exam/Submissions/Submission-02/main.cpp
Normal file
@@ -0,0 +1,121 @@
|
||||
// Submission-01.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "main.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
// printNaturalNumbers
|
||||
static void printNaturalNumbers(int aN)
|
||||
{
|
||||
if (aN <= 0) return; // Base case: if n is less than or equal to 0, do nothing
|
||||
printNaturalNumbers(aN - 1); // Recursive call with n-1
|
||||
std::cout << aN << " "; // Print the number after the recursive call to achieve ascending order
|
||||
}
|
||||
|
||||
// factorial function
|
||||
static int calculateFactorial(int aN)
|
||||
{
|
||||
if (aN <= 1) return 1; // Base case: factorial of 0 or 1 is 1
|
||||
return aN * calculateFactorial(aN - 1); // Recursive call
|
||||
}
|
||||
|
||||
// power function using exponentiation by squaring
|
||||
// This method is more efficient than the naive approach, reducing the time complexity from O(n) to O(log n).
|
||||
static int power(int aBase, int aExponent)
|
||||
{
|
||||
if (aExponent == 0) return 1; // Base case: any number to the power of 0 is 1
|
||||
if (aExponent < 0) return 1 / power(aBase, -aExponent); // Handle negative exponents
|
||||
if (aExponent % 2 == 0) // If exponent is even
|
||||
{
|
||||
int halfPower = power(aBase, aExponent / 2);
|
||||
return halfPower * halfPower; // (x^(n/2))^2
|
||||
}
|
||||
else // If exponent is odd
|
||||
{
|
||||
return aBase * power(aBase, aExponent - 1); // x * x^(n-1)
|
||||
}
|
||||
}
|
||||
|
||||
// Fibonacci function
|
||||
// Note: This naive recursive solution is inefficient because it recalculates the same Fibonacci numbers multiple times, leading to an exponential time complexity of O(2^n).
|
||||
// An improvement could be made by using memoization or an iterative approach to store previously calculated values, reducing the time complexity to O(n).
|
||||
static int fibonacci(int aN)
|
||||
{
|
||||
if (aN <= 0) return 0; // Base case: fibonacci(0) = 0
|
||||
if (aN == 1) return 1; // Base case: fibonacci(1) = 1
|
||||
int a = fibonacci(aN - 1);
|
||||
int b = fibonacci(aN - 2);
|
||||
std::cout << a << " + " << b << " = " << (a + b) << std::endl; // Print the sum of the two preceding numbers
|
||||
return a + b; // Recursive call
|
||||
}
|
||||
|
||||
// Count occurrences of a character in a string
|
||||
// This function counts how many times a specific character appears in a given string using recursion.
|
||||
static int countOccurrences(const char* aS, char aC)
|
||||
{
|
||||
if (*aS == '\0') return 0; // Base case: end of string
|
||||
return (*aS == aC ? 1 : 0) + countOccurrences(aS + 1, aC); // Check current character and recurse for the rest of the string
|
||||
}
|
||||
|
||||
// Find the largest element in an array using binary recursion
|
||||
// This function divides the array into two halves, finds the largest element in each half recursively, and then returns the larger of the two.
|
||||
static int findLargestElement(int arr[], int size)
|
||||
{
|
||||
if (size == 1) return arr[0]; // Base case: only one element
|
||||
int mid = size / 2;
|
||||
int leftMax = findLargestElement(arr, mid); // Find max in left half
|
||||
int rightMax = findLargestElement(arr + mid, size - mid); // Find max in right half
|
||||
return (leftMax > rightMax) ? leftMax : rightMax; // Return the larger of the two
|
||||
}
|
||||
|
||||
// Traverse and print characters in the ASCII table from aStart to aEnd using recursion
|
||||
// This function prints characters in ascending order during the building phase of the recursion and in descending order during the unwinding phase.
|
||||
static void traverseAsciiTable(char aStart, char aEnd)
|
||||
{
|
||||
if (aStart > aEnd) return; // Base case: if start exceeds end, do nothing
|
||||
std::cout << aStart << " "; // Print before the recursive call
|
||||
traverseAsciiTable(aStart + 1, aEnd); // Recursive call with next character
|
||||
std::cout << aStart << " "; // Print after the recursive call
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "--- Submission 2: Fundamental Recursion ---" << std::endl;
|
||||
std::cout << std::endl << "Part 1: Linear Recursion - Your First Steps" << std::endl;
|
||||
printNaturalNumbers(5);
|
||||
std::cout << std::endl << "------------------------------------------------" << std::endl;
|
||||
|
||||
std::cout << std::endl << "Factorial of 5: " << calculateFactorial(5);
|
||||
std::cout << std::endl << "------------------------------------------------" << std::endl;
|
||||
|
||||
std::cout << std::endl << "Part 2: Multiple & Binary Recursion - Diving Deeper" << std::endl;
|
||||
std::cout << std::endl << "2^10: " << power(2, 10);
|
||||
std::cout << std::endl << "------------------------------------------------" << std::endl;
|
||||
|
||||
std::cout << std::endl << "4th Fibonacci number: " << std::endl << fibonacci(4);
|
||||
std::cout << std::endl << "------------------------------------------------" << std::endl;
|
||||
|
||||
std::cout << std::endl << "Occurrences of 'l' in 'Hello, World!': " << countOccurrences("Hello, World!", 'l');
|
||||
std::cout << std::endl << "------------------------------------------------" << std::endl;
|
||||
|
||||
int* arr = new int[20];
|
||||
// Fill array with random numbers from 0 to 999
|
||||
for (int i = 0; i < 20; ++i) arr[i] = rand() % 999;
|
||||
std::cout << std::endl << "Part 3: Advanced Binary Recursion" << std::endl;
|
||||
// Print first 20 elements of the array
|
||||
for (int i = 0; i < 20; ++i) std::cout << arr[i] << " ";
|
||||
|
||||
std::cout << std::endl << "Largest element in array: " << findLargestElement(arr, 20);
|
||||
std::cout << std::endl << "------------------------------------------------" << std::endl;
|
||||
|
||||
std::cout << std::endl << "Traverse ASCII table from 'A' to 'Z':" << std::endl;
|
||||
traverseAsciiTable('A', 'Z');
|
||||
|
||||
/*
|
||||
Note: The output reflects the building and unwinding of the call stack.
|
||||
*/
|
||||
|
||||
std::cout << std::endl;
|
||||
return 0;
|
||||
}
|
||||
8
Exam/IKT203Exam/Submissions/Submission-02/main.h
Normal file
8
Exam/IKT203Exam/Submissions/Submission-02/main.h
Normal file
@@ -0,0 +1,8 @@
|
||||
// Submission-01.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: Reference additional headers your program requires here.
|
||||
13
Exam/IKT203Exam/Submissions/Submission-03/CMakeLists.txt
Normal file
13
Exam/IKT203Exam/Submissions/Submission-03/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
# CMakeList.txt : CMake project for Submission-01, include source and define
|
||||
# project specific logic here.
|
||||
#
|
||||
|
||||
# Add source to this project's executable.
|
||||
add_executable (Submission-03 "main.cpp" "main.h")
|
||||
target_link_libraries(Submission-03 PRIVATE LibExample)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.20)
|
||||
set_property(TARGET Submission-03 PROPERTY CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
# TODO: Add tests and install targets if needed.
|
||||
439
Exam/IKT203Exam/Submissions/Submission-03/main.cpp
Normal file
439
Exam/IKT203Exam/Submissions/Submission-03/main.cpp
Normal file
@@ -0,0 +1,439 @@
|
||||
// Submission-01.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "main.h"
|
||||
#include <iostream>
|
||||
|
||||
|
||||
/*
|
||||
Part 1: Implementing the Core Data Structures
|
||||
These tasks are designed to get you comfortable with the Last-In, First-Out (LIFO) and First-In, First-Out (FIFO) principles. Building these yourself will give you a deep understanding of how they work under the hood!
|
||||
*/
|
||||
|
||||
/*
|
||||
1. Implementing a Stack:
|
||||
a) Create a simple TStack class that can hold int values.
|
||||
b) Use a fixed-size array and a top-of-stack index to manage the data.
|
||||
c) Implement the core methods: Push(int item) and Pop().
|
||||
D) Add a Peek() method to view the top item without removing it.
|
||||
e) Include an IsEmpty() method to check if the stack is empty.
|
||||
*/
|
||||
|
||||
class TStackArray {
|
||||
private:
|
||||
int maxSize = 0;
|
||||
int* stackArray = nullptr;
|
||||
int top = -1; // Index of the top element
|
||||
public:
|
||||
TStackArray(int aSize) : maxSize(aSize) {
|
||||
stackArray = new int[maxSize];
|
||||
}
|
||||
~TStackArray() {
|
||||
delete[] stackArray;
|
||||
}
|
||||
void Push(int aItem) {
|
||||
if (top < maxSize - 1) {
|
||||
stackArray[++top] = aItem;
|
||||
}
|
||||
else {
|
||||
std::cout << "Stack Overflow" << std::endl;
|
||||
}
|
||||
}
|
||||
int Pop() {
|
||||
if (!IsEmpty()) {
|
||||
return stackArray[top--];
|
||||
}
|
||||
else {
|
||||
std::cout << "Stack Underflow" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
int Peek() const {
|
||||
if (!IsEmpty()) {
|
||||
return stackArray[top];
|
||||
}
|
||||
else {
|
||||
std::cout << "Stack is empty" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
bool IsEmpty() const {
|
||||
return top == -1;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
2. Implementing a Queue:
|
||||
a) Create a simple TQueue class that can hold int values.
|
||||
b) Use a fixed-size array and front/back indices to manage the data.
|
||||
c) Implement the core methods: Enqueue(int item) and Dequeue().
|
||||
d) Add a Peek() method to view the item at the front without removing it.
|
||||
e) Include an IsEmpty() method to check if the queue is empty.
|
||||
*/
|
||||
|
||||
class TQueueArray {
|
||||
private:
|
||||
int maxSize = 0;
|
||||
int* queueArray = nullptr;
|
||||
int front = 0; // Index of the front element
|
||||
int back = -1; // Index of the back element
|
||||
int itemCount = 0; // Number of items in the queue
|
||||
public:
|
||||
TQueueArray(int aSize) : maxSize(aSize) {
|
||||
queueArray = new int[maxSize];
|
||||
}
|
||||
~TQueueArray() {
|
||||
delete[] queueArray;
|
||||
}
|
||||
void Enqueue(int aItem) {
|
||||
if (itemCount < maxSize) {
|
||||
back = (back + 1) % maxSize; // Circular increment
|
||||
queueArray[back] = aItem;
|
||||
itemCount++;
|
||||
}
|
||||
else {
|
||||
std::cout << "Queue Overflow" << std::endl;
|
||||
}
|
||||
}
|
||||
int Dequeue() {
|
||||
if (!IsEmpty()) {
|
||||
int item = queueArray[front];
|
||||
front = (front + 1) % maxSize; // Circular increment
|
||||
itemCount--;
|
||||
return item;
|
||||
}
|
||||
else {
|
||||
std::cout << "Queue Underflow" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
int Peek() const {
|
||||
if (!IsEmpty()) {
|
||||
return queueArray[front];
|
||||
}
|
||||
else {
|
||||
std::cout << "Queue is empty" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
bool IsEmpty() const {
|
||||
return itemCount == 0;
|
||||
}
|
||||
};
|
||||
|
||||
class TNodeInteger {
|
||||
public:
|
||||
int data;
|
||||
TNodeInteger* next;
|
||||
TNodeInteger(int aData) : data(aData), next(nullptr) {}
|
||||
};
|
||||
|
||||
// Stack implemented using a linked list with dummy head node
|
||||
class TStackLinkedList {
|
||||
private:
|
||||
TNodeInteger* top = nullptr;
|
||||
public:
|
||||
TStackLinkedList() {
|
||||
top = new TNodeInteger(0); // Dummy head node
|
||||
}
|
||||
~TStackLinkedList() {
|
||||
while (!IsEmpty()) {
|
||||
Pop();
|
||||
}
|
||||
delete top; // Delete dummy head node
|
||||
}
|
||||
void Push(int aItem) {
|
||||
TNodeInteger* newNode = new TNodeInteger(aItem);
|
||||
newNode->next = top->next;
|
||||
top->next = newNode;
|
||||
}
|
||||
int Pop() {
|
||||
if (!IsEmpty()) {
|
||||
TNodeInteger* temp = top->next;
|
||||
int item = temp->data;
|
||||
top->next = temp->next;
|
||||
delete temp; // Free memory
|
||||
return item;
|
||||
}
|
||||
else {
|
||||
std::cout << "Stack Underflow" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
int Peek() const {
|
||||
if (!IsEmpty()) {
|
||||
return top->next->data;
|
||||
}
|
||||
else {
|
||||
std::cout << "Stack is empty" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
bool IsEmpty() const {
|
||||
return top->next == nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
// Queue implemented using a linked list with dummy head node
|
||||
class TQueueLinkedList {
|
||||
private:
|
||||
TNodeInteger* front = nullptr;
|
||||
TNodeInteger* back = nullptr;
|
||||
public:
|
||||
TQueueLinkedList() {
|
||||
front = new TNodeInteger(0); // Dummy head node
|
||||
back = front; // Initially, front and back point to the dummy node
|
||||
}
|
||||
~TQueueLinkedList() {
|
||||
while (!IsEmpty()) {
|
||||
Dequeue();
|
||||
}
|
||||
delete front; // Delete dummy head node
|
||||
}
|
||||
void Enqueue(int aItem) {
|
||||
TNodeInteger* newNode = new TNodeInteger(aItem);
|
||||
back->next = newNode;
|
||||
back = newNode;
|
||||
}
|
||||
int Dequeue() {
|
||||
if (!IsEmpty()) {
|
||||
TNodeInteger* temp = front->next;
|
||||
int item = temp->data;
|
||||
front->next = temp->next;
|
||||
if (back == temp) { // If the dequeued node was the last node
|
||||
back = front; // Reset back to the dummy head
|
||||
}
|
||||
delete temp; // Free memory
|
||||
return item;
|
||||
}
|
||||
else {
|
||||
std::cout << "Queue Underflow" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
int Peek() const {
|
||||
if (!IsEmpty()) {
|
||||
return front->next->data;
|
||||
}
|
||||
else {
|
||||
std::cout << "Queue is empty" << std::endl;
|
||||
return -1; // Indicate error
|
||||
}
|
||||
}
|
||||
bool IsEmpty() const {
|
||||
return front->next == nullptr;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Part 2: Practical Applications
|
||||
Now that you have your own data structures, it's time to put them to work! These are classic problems that perfectly demonstrate the LIFO and FIFO principles.
|
||||
*/
|
||||
|
||||
/*
|
||||
3. String Reversal with a Stack:
|
||||
a) Write a function that takes a string as input and uses your TStack to return the reversed string.
|
||||
b) In a short comment, explain why the stack is the perfect tool for this type of task.
|
||||
*/
|
||||
|
||||
static std::string ReverseString(const char* aStr) {
|
||||
TStackArray stack(strlen(aStr));
|
||||
for (int i = 0; aStr[i] != '\0'; i++) {
|
||||
stack.Push(aStr[i]);
|
||||
}
|
||||
std::string reversed;
|
||||
while (!stack.IsEmpty()) {
|
||||
reversed += static_cast<char>(stack.Pop()); // Cast int back to char
|
||||
}
|
||||
return reversed;
|
||||
/*
|
||||
* Note: The stack is the perfect tool for string reversal because it allows us to push each character of the string onto the stack and then pop them off in reverse order.
|
||||
* And stack is using the rule of LIFO (Last In First Out), so the last character pushed onto the stack will be the first one to be popped off, effectively reversing the order of characters.
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
4. Recursive Functions with a Stack:
|
||||
a) Remember the factorial function you implemented with recursion in Submission 2? Your computer used a hidden "call stack" to make that happen. Now, your task is to re-implement that function without recursion, using your own `TStack` to manage the process.
|
||||
b) This is a fantastic exercise that will give you a "eureka" moment about how recursion truly works!
|
||||
*/
|
||||
|
||||
static int Factorial(int n) {
|
||||
if (n < 0) return -1; // Factorial is not defined for negative numbers
|
||||
if (n == 0 || n == 1) return 1; // Base case
|
||||
TStackArray stack(n);
|
||||
for (int i = 2; i <= n; i++) {
|
||||
stack.Push(i);
|
||||
}
|
||||
int result = 1;
|
||||
while (!stack.IsEmpty()) {
|
||||
result *= stack.Pop();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
5. Wait Line Simulation with a Queue:
|
||||
a) Simulate a simple waiting line, such as a ticket counter.
|
||||
b) Use your TQueue to manage a list of people (represented by integer IDs).
|
||||
c) People should Enqueue when they arrive and Dequeue when they are served, clearly demonstrating the FIFO principle.
|
||||
*/
|
||||
|
||||
static void SimulateWaitLine() {
|
||||
TQueueArray queue(5); // Queue with a maximum size of 5
|
||||
// Simulate people arriving
|
||||
for (int i = 1; i <= 5; i++) {
|
||||
std::cout << "Person " << i << " arrives." << std::endl;
|
||||
queue.Enqueue(i);
|
||||
}
|
||||
// Simulate serving people
|
||||
while (!queue.IsEmpty()) {
|
||||
int person = queue.Dequeue();
|
||||
std::cout << "Person " << person << " is served." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Part 3: Advanced Traversal - Stacks vs. Queues
|
||||
This is the main event! You will solve the same problem using two different approaches, highlighting the different strengths of stacks and queues.
|
||||
Your recursive functions from Submission 2 actually use an implicit stack, so this task will give you a deeper look into how it all works.
|
||||
*/
|
||||
|
||||
/*
|
||||
6. Setup: The 100x100 Grid:
|
||||
a) Create a 100x100 two-dimensional integer array.
|
||||
b) Populate the array with random integer values between 0 and 9.
|
||||
c) Choose a random starting cell (row, col).
|
||||
d) Create a second 100x100 boolean array to keep track of visited cells.
|
||||
*/
|
||||
|
||||
|
||||
static const int GRID_SIZE = 7;
|
||||
static int grid[GRID_SIZE][GRID_SIZE];
|
||||
static bool visited[GRID_SIZE][GRID_SIZE] = { false };
|
||||
#include <cstdlib>
|
||||
#include <ctime>
|
||||
static void InitializeGrid() {
|
||||
std::srand(static_cast<unsigned int>(std::time(0))); // Seed for randomness
|
||||
for (int i = 0; i < GRID_SIZE; i++) {
|
||||
for (int j = 0; j < GRID_SIZE; j++) {
|
||||
grid[i][j] = std::rand() % 9; // Random values between 0 and 9
|
||||
visited[i][j] = false; // Initialize visited array
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
7. Depth-First Search (DFS) with a Stack:
|
||||
a) Write a function that uses your TStack to perform a DFS on the grid, starting from your random cell.
|
||||
b) The goal is to find the first occurrence of the number '0'.
|
||||
c) In a short comment, explain how the LIFO behavior of the stack guides the search to explore as deeply as possible along one path before backtracking.
|
||||
*/
|
||||
|
||||
|
||||
// Helper function to check if a cell is within bounds and not visited
|
||||
static bool IsValid(int aRow, int aCol) {
|
||||
return aRow >= 0 && aRow < GRID_SIZE && aCol >= 0 && aCol < GRID_SIZE && !visited[aRow][aCol];
|
||||
}
|
||||
|
||||
// The stack's LIFO behavior allows the DFS to explore one path fully before backtracking, ensuring that all possible routes are checked in depth-first order.
|
||||
static bool DFS(int aStartRow, int aStartCol) {
|
||||
TStackArray stack(GRID_SIZE * GRID_SIZE);
|
||||
int cellPos = aStartRow * GRID_SIZE + aStartCol; // Encode 2D position as 1D
|
||||
stack.Push(cellPos);
|
||||
while (!stack.IsEmpty()) {
|
||||
cellPos = stack.Pop();
|
||||
int row = cellPos / GRID_SIZE;
|
||||
int col = cellPos % GRID_SIZE;
|
||||
if (grid[row][col] == 0) {
|
||||
std::cout << "Found 0 at (" << row << ", " << col << ")" << std::endl;
|
||||
return true;
|
||||
}
|
||||
std::cout << "Visiting (" << row << ", " << col << ") with value " << grid[row][col] << std::endl;
|
||||
visited[row][col] = true;
|
||||
int neighbors[4][2] = { {row - 1, col}, {row, col + 1}, {row + 1, col}, {row, col - 1} };
|
||||
for (int i = 0; i < 4; i++) {
|
||||
int newRow = neighbors[i][0];
|
||||
int newCol = neighbors[i][1];
|
||||
if (IsValid(newRow, newCol)) {
|
||||
cellPos = newRow * GRID_SIZE + newCol;
|
||||
stack.Push(cellPos);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "0 not found in DFS" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
// The queue's FIFO behavior ensures that the BFS explores all neighbors at the present depth prior to moving on to nodes at the next depth level, effectively searching layer by layer.
|
||||
static bool BFS(int aStartRow, int aStartCol) {
|
||||
int row = aStartRow, col = aStartCol;
|
||||
int pos = row * GRID_SIZE + col; // Encode 2D position as 1D
|
||||
TQueueArray queue(GRID_SIZE * GRID_SIZE);
|
||||
queue.Enqueue(pos);
|
||||
while (!queue.IsEmpty()) {
|
||||
pos = queue.Dequeue();
|
||||
row = pos / GRID_SIZE;
|
||||
col = pos % GRID_SIZE;
|
||||
if (grid[row][col] == 0) {
|
||||
std::cout << "Found 0 at (" << row << ", " << col << ")" << std::endl;
|
||||
return true;
|
||||
}
|
||||
std::cout << "Visiting (" << row << ", " << col << ") with value " << grid[row][col] << std::endl;
|
||||
visited[row][col] = true;
|
||||
int neighbors[4][2] = { {row - 1, col}, {row, col + 1},{row + 1, col},{row, col - 1} };
|
||||
for (int i = 0; i < 4; i++) {
|
||||
row = neighbors[i][0];
|
||||
col = neighbors[i][1];
|
||||
if (IsValid(row, col)) {
|
||||
pos = row * GRID_SIZE + col;
|
||||
queue.Enqueue(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << "0 not found in BFS" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "--- Submission 3: Stacks & Queues ---" << std::endl;
|
||||
std::string original = "Hello, World!";
|
||||
std::string reversed = ReverseString(original.c_str());
|
||||
std::cout << "Original String: " << original << std::endl;
|
||||
std::cout << "Reversed String: " << reversed << std::endl;
|
||||
// The stack is the perfect tool for string reversal because it operates on a Last-In, First-Out (LIFO) principle.
|
||||
// This means that the last character pushed onto the stack will be the first one to be popped off, effectively reversing the order of characters.
|
||||
std::cout << "----------------------------------------------------" << std::endl << std::endl;
|
||||
|
||||
std::cout << "Calculating Factorial of 5 using Stack:" << std::endl;
|
||||
std::cout << "5! = " << Factorial(5) << std::endl;
|
||||
std::cout << "----------------------------------------------------" << std::endl << std::endl;
|
||||
|
||||
std::cout << "Simulating Wait Line using Queue:" << std::endl;
|
||||
SimulateWaitLine();
|
||||
std::cout << "----------------------------------------------------" << std::endl << std::endl;
|
||||
|
||||
std::cout << "Initializing 100x100 Grid and Performing DFS to find '0':" << std::endl;
|
||||
InitializeGrid();
|
||||
int startRow = 3; //std::rand() % GRID_SIZE;
|
||||
int startCol = 2; //std::rand() % GRID_SIZE;
|
||||
std::cout << "Starting DFS from (" << startRow << ", " << startCol << ")" << std::endl;
|
||||
DFS(startRow, startCol);
|
||||
std::cout << std::endl << "Re-initializing visited array for BFS:" << std::endl;
|
||||
for (int i = 0; i < GRID_SIZE; i++) {
|
||||
for (int j = 0; j < GRID_SIZE; j++) {
|
||||
visited[i][j] = false; // Reset visited array
|
||||
}
|
||||
}
|
||||
std::cout << "Stating BFS from (" << startRow << ", " << startCol << ")" << std::endl;
|
||||
BFS(startRow, startCol); // This should find a different path to '0'
|
||||
std::cout << "----------------------------------------------------" << std::endl << std::endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
8
Exam/IKT203Exam/Submissions/Submission-03/main.h
Normal file
8
Exam/IKT203Exam/Submissions/Submission-03/main.h
Normal file
@@ -0,0 +1,8 @@
|
||||
// Submission-01.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: Reference additional headers your program requires here.
|
||||
108
Exam/IKT203Exam/Submissions/Submission-04/BankAccount.cpp
Normal file
108
Exam/IKT203Exam/Submissions/Submission-04/BankAccount.cpp
Normal file
@@ -0,0 +1,108 @@
|
||||
#include "BankAccount.h"
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <cstdlib> // For rand()
|
||||
#include <random> // For better random number generation
|
||||
#include <ctime>
|
||||
#include <cstring> // For memset
|
||||
#include <cmath> // For floor
|
||||
#include <chrono> // For time manipulation
|
||||
#include <locale> // For locale settings
|
||||
#include <codecvt> // For codecvt_utf8
|
||||
#include <stdexcept> // For std::invalid_argument
|
||||
#include <string>
|
||||
|
||||
|
||||
TBankAccount::TBankAccount(EBankAccountType accType, std::string firstName, std::string lastName)
|
||||
: accountType(accType), ownerFirstName(firstName), ownerLastName(lastName)
|
||||
{
|
||||
// Random genration of account number: XXXX.XX.XXXXX
|
||||
accountNumber = toString(rand() % 9000 + 1000) + "." + toString(rand() % 90 + 10) + "." + toString(rand() % 90000 + 10000);
|
||||
|
||||
balance = 0.0f;
|
||||
|
||||
//Random generation of creation timestamp, date is any date and time in 2024
|
||||
int month = rand() % 12 + 1;
|
||||
int day = rand() % 28 + 1; // To avoid complexity of different month lengths
|
||||
int hour = rand() % 24;
|
||||
int minute = rand() % 60;
|
||||
|
||||
// Calculate creation timestamp in seconds from 2024-01-01 00:00:00
|
||||
std:tm tm = {};
|
||||
tm.tm_year = 2024 - 1900; // Year since 1900
|
||||
tm.tm_mon = rand() % 12; // Month [0-11]
|
||||
tm.tm_mday = rand() % 28 + 1; // Day of the month [1-28] to avoid month length issues
|
||||
tm.tm_hour = rand() % 24; // Hour [0-23]
|
||||
tm.tm_min = rand() % 60; // Minute [0-59]
|
||||
tm.tm_sec = 0; // Second [0-59]
|
||||
creationTimestamp = _mkgmtime(&tm); // Use _mkgmtime for UTC
|
||||
|
||||
if (accType == Checking || accType == Saving || accType == Pension)
|
||||
balance = static_cast<double>(rand() % 1001); // 0 to 1000
|
||||
else if (accType == Loan)
|
||||
balance = static_cast<double>(-(rand() % 25001 + 25000)); // -50000 to -25000
|
||||
else if (accType == Credit)
|
||||
balance = static_cast<double>(-(rand() % 1001)); // -1000 to 0
|
||||
}
|
||||
|
||||
TBankAccount::~TBankAccount()
|
||||
{
|
||||
// Destructor logic if needed
|
||||
}
|
||||
|
||||
std::string TBankAccount::getAccountNumber() const {
|
||||
return accountNumber;
|
||||
}
|
||||
|
||||
EBankAccountType TBankAccount::getAccountType() const {
|
||||
return accountType;
|
||||
}
|
||||
|
||||
time_t TBankAccount::getCreationTimestamp() const {
|
||||
return creationTimestamp;
|
||||
}
|
||||
double TBankAccount::getBalance() const {
|
||||
return balance;
|
||||
}
|
||||
void TBankAccount::deposit(double aAmount) {
|
||||
if (aAmount > 0) balance += aAmount;
|
||||
}
|
||||
|
||||
void TBankAccount::withdraw(double aAmount) {
|
||||
if (aAmount > 0 && aAmount <= balance) balance -= aAmount;
|
||||
}
|
||||
|
||||
std::string TBankAccount::getAccountTypeString() const
|
||||
{
|
||||
switch (accountType)
|
||||
{
|
||||
case Checking: return "Checking";
|
||||
case Saving: return "Saving";
|
||||
case Credit: return "Credit";
|
||||
case Pension: return "Pension";
|
||||
case Loan: return "Loan";
|
||||
default: return "Unknown";
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
std::string TBankAccount::getCreationTimeString() const
|
||||
{
|
||||
char buffer[26];
|
||||
ctime_s(buffer, sizeof(buffer), &creationTimestamp);
|
||||
std::string timeString(buffer);
|
||||
if (!timeString.empty() && timeString.back() == '\n') {
|
||||
timeString.pop_back(); // Remove the trailing newline character
|
||||
}
|
||||
return timeString;
|
||||
}
|
||||
|
||||
void TBankAccount::printAccountInfo() const
|
||||
{
|
||||
std::cout << "Account Number: " << accountNumber << ", Type: " << getAccountTypeString()
|
||||
<< ", Owner: " << ownerFirstName << " " << ownerLastName
|
||||
<< ", Balance: " << balance
|
||||
<< ", Created: " << getCreationTimeString()
|
||||
<< std::endl;
|
||||
}
|
||||
52
Exam/IKT203Exam/Submissions/Submission-04/BankAccount.h
Normal file
52
Exam/IKT203Exam/Submissions/Submission-04/BankAccount.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#pragma once
|
||||
#ifndef BANKACCOUNT_H
|
||||
#define BANKACCOUNT_H
|
||||
|
||||
#include <string> // For std::string
|
||||
#include <ctime> // For time_t
|
||||
#include <cstdlib> // For rand()
|
||||
#include <iomanip> // For std::setfill and std::setw
|
||||
#include <sstream> // For std::ostringstream
|
||||
#include <iostream> // For std::cout
|
||||
|
||||
|
||||
// Helper function to convert value to string
|
||||
template <typename T>
|
||||
std::string toString(T value)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
oss << value;
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
||||
enum EBankAccountType { Checking, Saving, Credit, Pension, Loan };
|
||||
|
||||
class TBankAccount {
|
||||
|
||||
private:
|
||||
std::string accountNumber;
|
||||
EBankAccountType accountType;
|
||||
time_t creationTimestamp;
|
||||
double balance;
|
||||
|
||||
public:
|
||||
std::string ownerFirstName;
|
||||
std::string ownerLastName;
|
||||
|
||||
//TBankAccount() {} // Don't use default constructor
|
||||
TBankAccount(EBankAccountType, std::string, std::string);
|
||||
~TBankAccount();
|
||||
|
||||
std::string getAccountNumber() const;
|
||||
std::string getCreationTimeString() const;
|
||||
time_t getCreationTimestamp() const;
|
||||
double getBalance() const;
|
||||
void deposit(double);
|
||||
void withdraw(double);
|
||||
EBankAccountType getAccountType() const;
|
||||
std::string getAccountTypeString() const;
|
||||
void printAccountInfo() const;
|
||||
};
|
||||
|
||||
#endif // BANKACCOUNT_H
|
||||
130
Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.cpp
Normal file
130
Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.cpp
Normal file
@@ -0,0 +1,130 @@
|
||||
#include "BankAccountList.h"
|
||||
|
||||
TLinkedList::TLinkedList(bool aOwnsData) : head(nullptr), ownsData(aOwnsData), size(0) {
|
||||
head = new TLinkedListNode(nullptr); // Dummy head node
|
||||
}
|
||||
|
||||
TLinkedList::~TLinkedList()
|
||||
{
|
||||
while (head->next != nullptr)
|
||||
{
|
||||
TLinkedListNode* temp = head->next;
|
||||
head->next = temp->next;
|
||||
if (ownsData) delete temp->data; // Delete the TBankAccount object
|
||||
delete temp; // Delete the node
|
||||
}
|
||||
delete head;
|
||||
}
|
||||
|
||||
int TLinkedList::getSize() const { return size; }
|
||||
|
||||
void TLinkedList::Add(TBankAccount* aData)
|
||||
{
|
||||
TLinkedListNode* newNode = new TLinkedListNode(aData);
|
||||
newNode->next = head->next;
|
||||
head->next = newNode;
|
||||
size++;
|
||||
}
|
||||
|
||||
TBankAccount* TLinkedList::Find(FCompareAccount aCompareFunc, void* aSearchKey)
|
||||
{
|
||||
TLinkedListNode* current = head->next;
|
||||
while (current != nullptr)
|
||||
{
|
||||
if (aCompareFunc(current->data, aSearchKey))
|
||||
{
|
||||
return current->data; // Found
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
return nullptr; // Not found
|
||||
}
|
||||
|
||||
TLinkedList* TLinkedList::Every(FCompareAccount aCompareFunc, void* aSearchKey)
|
||||
{
|
||||
TLinkedList* resultList = new TLinkedList(false); // New list does not own data
|
||||
TLinkedListNode* current = head->next;
|
||||
while (current != nullptr)
|
||||
{
|
||||
if (aCompareFunc(current->data, aSearchKey))
|
||||
{
|
||||
resultList->Add(current->data); // Add to result list
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
return resultList; // Return the new list
|
||||
}
|
||||
|
||||
// Loop through all accounts, if aEveryFunc returns false for any, return that account
|
||||
TBankAccount* TLinkedList::Every(FEveryAccount aEveryFunc) {
|
||||
TLinkedListNode* current = head->next;
|
||||
int index = 0;
|
||||
while (current != nullptr)
|
||||
{
|
||||
if (!aEveryFunc(current->data, index++))
|
||||
{
|
||||
return current->data; // Return the first account that fails the test
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
return nullptr; // All accounts passed the test
|
||||
}
|
||||
|
||||
TBankAccount** TLinkedList::ToArray()
|
||||
{
|
||||
if (size == 0) return nullptr;
|
||||
TBankAccount** array = new TBankAccount * [size];
|
||||
TLinkedListNode* current = head->next;
|
||||
int index = 0;
|
||||
while (current != nullptr && index < size) // Ensure index < size
|
||||
{
|
||||
array[index++] = current->data;
|
||||
current = current->next;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
void TLinkedList::forEach(FForEachAccount aFunc)
|
||||
{
|
||||
TLinkedListNode* current = head->next;
|
||||
int index = 0;
|
||||
while (current != nullptr)
|
||||
{
|
||||
aFunc(current->data, index++);
|
||||
current = current->next;
|
||||
}
|
||||
}
|
||||
|
||||
TLinkedListNode* TLinkedList::getHead() const { return head; }
|
||||
|
||||
void TLinkedList::Append(TBankAccount* account)
|
||||
{
|
||||
TLinkedListNode* newNode = new TLinkedListNode(account);
|
||||
TLinkedListNode* current = head;
|
||||
while (current->next != nullptr)
|
||||
{
|
||||
current = current->next;
|
||||
}
|
||||
current->next = newNode;
|
||||
size++;
|
||||
}
|
||||
|
||||
void TLinkedList::Remove(TBankAccount* account)
|
||||
{
|
||||
TLinkedListNode* current = head;
|
||||
while (current->next != nullptr)
|
||||
{
|
||||
if (current->next->data == account)
|
||||
{
|
||||
TLinkedListNode* temp = current->next;
|
||||
current->next = temp->next;
|
||||
if (ownsData) delete temp->data; // Delete the TBankAccount object
|
||||
delete temp; // Delete the node
|
||||
size--;
|
||||
return; // Exit after removing
|
||||
}
|
||||
current = current->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
51
Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.h
Normal file
51
Exam/IKT203Exam/Submissions/Submission-04/BankAccountList.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
#ifndef BANKACCOUNTLIST_H
|
||||
#define BANKACCOUNTLIST_H
|
||||
#include "BankAccount.h"
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
typedef bool (*FCompareAccount)(TBankAccount* account, void* searchKey);
|
||||
typedef void (*FForEachAccount)(TBankAccount* account, int index);
|
||||
typedef bool (*FEveryAccount)(TBankAccount*, int);
|
||||
|
||||
// Node class for linked list
|
||||
class TLinkedListNode
|
||||
{
|
||||
public:
|
||||
TBankAccount* data;
|
||||
TLinkedListNode* next;
|
||||
TLinkedListNode(TBankAccount* aData) : data(aData), next(nullptr) {}
|
||||
~TLinkedListNode()
|
||||
{
|
||||
// Destructor logic if needed
|
||||
}
|
||||
};
|
||||
|
||||
// Use dummy head node for simplicity
|
||||
class TLinkedList
|
||||
{
|
||||
private:
|
||||
TLinkedListNode* head;
|
||||
bool ownsData;
|
||||
int size;
|
||||
public:
|
||||
TLinkedList(bool);
|
||||
~TLinkedList();
|
||||
int getSize() const;
|
||||
TLinkedListNode* getHead() const;
|
||||
|
||||
void Add(TBankAccount*);
|
||||
|
||||
TBankAccount* Find(FCompareAccount, void*);
|
||||
|
||||
TLinkedList* Every(FCompareAccount, void*);
|
||||
TBankAccount* Every(FEveryAccount aEveryFunc);
|
||||
TBankAccount** ToArray();
|
||||
void forEach(FForEachAccount);
|
||||
|
||||
void Append(TBankAccount* account);
|
||||
void Remove(TBankAccount* account);
|
||||
};
|
||||
|
||||
#endif// BANKACCOUNTLIST_H
|
||||
25
Exam/IKT203Exam/Submissions/Submission-04/CMakeLists.txt
Normal file
25
Exam/IKT203Exam/Submissions/Submission-04/CMakeLists.txt
Normal file
@@ -0,0 +1,25 @@
|
||||
# CMakeList.txt : CMake project for Submission-01, include source and define
|
||||
# project specific logic here.
|
||||
#
|
||||
|
||||
# Add source to this project's executable.
|
||||
add_executable (Submission-04 "main.cpp" "main.h" "BankAccount.h" "ReadNames.cpp" "ReadNames.h" "BankAccount.cpp" "BankAccount.h" "BankAccountList.cpp" "BankAccountList.h")
|
||||
target_link_libraries(Submission-04 PRIVATE LibExample)
|
||||
|
||||
# Add source files to a Submission04Lib library
|
||||
add_library(Submission04Lib
|
||||
BankAccount.cpp
|
||||
BankAccount.h
|
||||
ReadNames.cpp
|
||||
ReadNames.h
|
||||
BankAccountList.cpp
|
||||
BankAccountList.h
|
||||
)
|
||||
|
||||
target_include_directories(Submission04Lib PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.20)
|
||||
set_property(TARGET Submission-03 PROPERTY CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
# TODO: Add tests and install targets if needed.
|
||||
31
Exam/IKT203Exam/Submissions/Submission-04/ReadNames.cpp
Normal file
31
Exam/IKT203Exam/Submissions/Submission-04/ReadNames.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
#include "ReadNames.h"
|
||||
|
||||
void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead)
|
||||
{
|
||||
if (aFilename.empty()) return;
|
||||
std::ifstream file(aFilename);
|
||||
if (!file.is_open())
|
||||
{
|
||||
std::cerr << "Error opening file: " << aFilename << std::endl;
|
||||
return;
|
||||
}
|
||||
std::string line;
|
||||
while (std::getline(file, line))
|
||||
{
|
||||
std::istringstream iss(line);
|
||||
std::string firstName, lastName;
|
||||
if (iss >> firstName >> lastName)
|
||||
{
|
||||
if (aOnNameRead) // If the callback is set, call it
|
||||
{
|
||||
//If the function returns false, stop reading further
|
||||
if (!aOnNameRead(firstName, lastName)) break;
|
||||
}
|
||||
}
|
||||
}
|
||||
file.close();
|
||||
}
|
||||
30
Exam/IKT203Exam/Submissions/Submission-04/ReadNames.h
Normal file
30
Exam/IKT203Exam/Submissions/Submission-04/ReadNames.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
#ifndef READNAMES_H
|
||||
#define SHARED_LIB_H
|
||||
#include <string>
|
||||
#include <functional>
|
||||
|
||||
/// <summary>
|
||||
/// Use this delegate type to define a callback function for processing names read from a file.
|
||||
/// </summary>
|
||||
/// <delegate>FNameRead</delegate>
|
||||
/// <description>A function pointer type for a callback that processes names read from a file.</description>
|
||||
/// <param name="firstName">The first name read from the file.</param>
|
||||
/// <param name="lastName">The last name read from the file.</param>
|
||||
/// <returns>Returns true to continue reading names, or false to stop.</returns>
|
||||
typedef bool (*FNameRead)(const std::string& firstName, const std::string& lastName);
|
||||
|
||||
/// <summary>
|
||||
/// Use this function to read names from a specified file and process them using a callback function.
|
||||
/// </summary>
|
||||
/// <function>readNamesFromFile</function>
|
||||
/// <description>Reads names from a specified file and invokes a callback for each name read.</description>
|
||||
/// <param name="aFilename">The path to the file containing names.</param>
|
||||
/// <param name="aOnNameRead">A callback function that is called for each name read. It takes two parameters: firstName and lastName. If the callback returns false, the reading process stops.</param>
|
||||
/// <param name="firstName">The first name read from the file.</param>
|
||||
/// <param name="lastName">The last name read from the file.</param>
|
||||
/// <returns>None.</returns>
|
||||
void readNamesFromFile(const std::string& aFilename, FNameRead aOnNameRead);
|
||||
|
||||
|
||||
#endif // READNAMES_H
|
||||
180
Exam/IKT203Exam/Submissions/Submission-04/main.cpp
Normal file
180
Exam/IKT203Exam/Submissions/Submission-04/main.cpp
Normal file
@@ -0,0 +1,180 @@
|
||||
// Submission-01.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "main.h"
|
||||
#include "ReadNames.h" // For reading names from file
|
||||
#include "BankAccount.h" // For TBankAccount and EBankAccountType
|
||||
#include "BankAccountList.h" // For TLinkedList
|
||||
#include <string> // For std::getline and std::string
|
||||
#include <iostream> // For std::cout
|
||||
#include <sstream> // For std::istringstream
|
||||
|
||||
|
||||
|
||||
// For statistics
|
||||
typedef struct _TSummary {
|
||||
long comparisonCount = 0;
|
||||
double timeTaken = 0.0;
|
||||
}TSummary;
|
||||
static TSummary statistics;
|
||||
|
||||
|
||||
|
||||
static EBankAccountType getRandomAccountType()
|
||||
{
|
||||
return static_cast<EBankAccountType>(rand() % 5); // Randomly returns one of the 5 account types
|
||||
}
|
||||
|
||||
TLinkedList* bankAccounts = new TLinkedList(true); // List owns the TBankAccount objects
|
||||
TBankAccount** bankAccountArray = nullptr;
|
||||
|
||||
|
||||
static bool OnNameRead(const std::string& firstName, const std::string& lastName)
|
||||
{
|
||||
//For each name read, create from 5 to 10 random bank accounts
|
||||
int accountCount = rand() % 6 + 5; // Random number between 5 and 10
|
||||
for (int i = 0; i < accountCount; i++)
|
||||
{
|
||||
EBankAccountType accType = getRandomAccountType();
|
||||
TBankAccount* newAccount = new TBankAccount(accType, firstName, lastName);
|
||||
bankAccounts->Add(newAccount);
|
||||
}
|
||||
return true; //bankAccounts->getSize() < 100; // For demo purposes
|
||||
}
|
||||
|
||||
static void resetStatistics()
|
||||
{
|
||||
statistics.comparisonCount = 0;
|
||||
statistics.timeTaken = (static_cast<double>(clock())) / CLOCKS_PER_SEC;
|
||||
}
|
||||
|
||||
static void printStastics() {
|
||||
statistics.timeTaken = (static_cast<double>(clock())) / CLOCKS_PER_SEC - statistics.timeTaken;
|
||||
std::cout << "Comparisons: " << statistics.comparisonCount << ", Time taken: " << statistics.timeTaken << " seconds." << std::endl;
|
||||
}
|
||||
|
||||
/*
|
||||
Part 3: Standalone Search Functions (The External Analyst)
|
||||
To simulate working with data from different perspectives, you will also implement search functions that are not part of the list class. These functions will operate on a simple array of pointers.
|
||||
*/
|
||||
|
||||
static TBankAccount* FindAccountByNumber(TBankAccount** accountArray, int arraySize, const std::string& accountNumber) {
|
||||
if (accountArray == nullptr || arraySize <= 0) return nullptr;
|
||||
for (int i = 0; i < arraySize; i++) {
|
||||
statistics.comparisonCount++;
|
||||
if (accountArray[i]->getAccountNumber() == accountNumber) {
|
||||
return accountArray[i]; // Found
|
||||
}
|
||||
}
|
||||
return nullptr; // Not found
|
||||
}
|
||||
|
||||
static void PrintEveryAccountInDateRange(TBankAccount** accountArray, int arraySize, time_t from, time_t to) {
|
||||
if (accountArray == nullptr || arraySize <= 0) return;
|
||||
std::cout << "------------------------------" << std::endl;
|
||||
resetStatistics();
|
||||
int foundCount = 0;
|
||||
for (int i = 0; i < arraySize; i++) {
|
||||
statistics.comparisonCount++;
|
||||
time_t ts = accountArray[i]->getCreationTimestamp();
|
||||
if (ts >= from && ts < to) {
|
||||
std::cout << i + 1 << ". ";
|
||||
accountArray[i]->printAccountInfo();
|
||||
foundCount++;
|
||||
}
|
||||
}
|
||||
printStastics();
|
||||
std::cout << "Total accounts found in date range: " << foundCount << std::endl;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "--- Submission 4: Sosrt & Search ---" << std::endl;
|
||||
|
||||
// Test TBankAccount
|
||||
//Gen random account type
|
||||
//Change this name for you own names file
|
||||
std::string namesFile = "F:\\IKT203\\VisualStudio\\DATA\\Random_Name.txt";
|
||||
std::cout << "Reading names from file: " << namesFile << std::endl;
|
||||
readNamesFromFile(namesFile, OnNameRead);
|
||||
std::cout << "Total Bank Accounts Created: " << bankAccounts->getSize() << std::endl;
|
||||
std::cout << "Converting linked list to array..." << std::endl;
|
||||
bankAccountArray = bankAccounts->ToArray();
|
||||
std::cout << "Array created with " << bankAccounts->getSize() << " accounts." << std::endl;
|
||||
|
||||
|
||||
resetStatistics();
|
||||
int getRandomIndex = rand() % bankAccounts->getSize();
|
||||
TBankAccount* foundAccount = FindAccountByNumber(bankAccountArray, bankAccounts->getSize(), bankAccountArray[getRandomIndex]->getAccountNumber());
|
||||
if (foundAccount)
|
||||
{
|
||||
std::cout << "Found Account: " << std::endl;
|
||||
foundAccount->printAccountInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Account not found." << std::endl;
|
||||
}
|
||||
printStastics();
|
||||
|
||||
resetStatistics();
|
||||
foundAccount = FindAccountByNumber(bankAccountArray, bankAccounts->getSize(), "1234.56.78901");
|
||||
if (foundAccount)
|
||||
{
|
||||
std::cout << "Found Account: " << std::endl;
|
||||
foundAccount->printAccountInfo();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "Account not found." << std::endl;
|
||||
}
|
||||
printStastics();
|
||||
|
||||
// Find All (Integrated): Use your Every() method to find all accounts created in June 2024 and print their details.
|
||||
resetStatistics();
|
||||
struct June2024Key {
|
||||
time_t start;
|
||||
time_t end;
|
||||
};
|
||||
June2024Key juneKey{};
|
||||
std::tm fromToTm = {};
|
||||
fromToTm.tm_year = 2024 - 1900; // Year since 1900
|
||||
fromToTm.tm_mon = 5; // June (0-based)
|
||||
fromToTm.tm_mday = 1; // 1st
|
||||
fromToTm.tm_hour = 0;
|
||||
fromToTm.tm_min = 0;
|
||||
fromToTm.tm_sec = 0;
|
||||
juneKey.start = _mkgmtime(&fromToTm); // Use _mkgmtime for UTC
|
||||
fromToTm.tm_mday = 30; // 30th
|
||||
fromToTm.tm_hour = 23;
|
||||
fromToTm.tm_min = 59;
|
||||
fromToTm.tm_sec = 59;
|
||||
juneKey.end = _mkgmtime(&fromToTm); // Use _mkgmtime for UTC
|
||||
|
||||
TLinkedList* juneAccounts = bankAccounts->Every(
|
||||
[](TBankAccount* account, void* searchKey) -> bool {
|
||||
June2024Key* key = static_cast<June2024Key*>(searchKey);
|
||||
time_t ts = account->getCreationTimestamp();
|
||||
return ts >= key->start && ts < key->end;
|
||||
}, &juneKey);
|
||||
|
||||
std::cout << "Accounts created in June 2024: " << juneAccounts->getSize() << std::endl;
|
||||
printStastics();
|
||||
|
||||
juneAccounts->forEach(
|
||||
[](TBankAccount* aAccount, int aIndex) {
|
||||
std::cout << aIndex + 1 << ". ";
|
||||
aAccount->printAccountInfo();
|
||||
});
|
||||
|
||||
PrintEveryAccountInDateRange(bankAccountArray, bankAccounts->getSize(), juneKey.start, juneKey.end);
|
||||
|
||||
|
||||
// Cleanup
|
||||
// First delete the array, then the linked list
|
||||
delete[] bankAccountArray;
|
||||
delete bankAccounts;
|
||||
|
||||
return 0;
|
||||
}
|
||||
8
Exam/IKT203Exam/Submissions/Submission-04/main.h
Normal file
8
Exam/IKT203Exam/Submissions/Submission-04/main.h
Normal file
@@ -0,0 +1,8 @@
|
||||
// Submission-01.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: Reference additional headers your program requires here.
|
||||
13
Exam/IKT203Exam/Submissions/Submission-05/CMakeLists.txt
Normal file
13
Exam/IKT203Exam/Submissions/Submission-05/CMakeLists.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
# CMakeList.txt : CMake project for Submission-01, include source and define
|
||||
# project specific logic here.
|
||||
#
|
||||
|
||||
# Add source to this project's executable.
|
||||
add_executable (Submission-05 "main.cpp" "main.h")
|
||||
target_link_libraries(Submission-05 PRIVATE Submission04Lib LibExample)
|
||||
|
||||
if (CMAKE_VERSION VERSION_GREATER 3.20)
|
||||
set_property(TARGET Submission-05 PROPERTY CXX_STANDARD 20)
|
||||
endif()
|
||||
|
||||
# TODO: Add tests and install targets if needed.
|
||||
828
Exam/IKT203Exam/Submissions/Submission-05/main.cpp
Normal file
828
Exam/IKT203Exam/Submissions/Submission-05/main.cpp
Normal file
@@ -0,0 +1,828 @@
|
||||
// Submission-01.cpp : Defines the entry point for the application.
|
||||
//
|
||||
|
||||
#include "ReadNames.h" // For reading names from file
|
||||
#include "BankAccount.h" // For TBankAccount and EBankAccountType
|
||||
#include "BankAccountList.h" // For TLinkedList
|
||||
#include <string> // For std::getline and std::string
|
||||
#include <iostream> // For std::cout
|
||||
#include <sstream> // For std::istringstream
|
||||
|
||||
|
||||
|
||||
// For statistics
|
||||
typedef struct _TSummary {
|
||||
long long comparisonCount = 0;
|
||||
long long swaps = 0;
|
||||
double timeTaken = 0.0;
|
||||
}TSummary;
|
||||
static TSummary statistics;
|
||||
|
||||
|
||||
static void resetStatistics()
|
||||
{
|
||||
statistics.comparisonCount = 0;
|
||||
statistics.swaps = 0;
|
||||
statistics.timeTaken = (static_cast<double>(clock())) / CLOCKS_PER_SEC;
|
||||
}
|
||||
|
||||
static void printStastics() {
|
||||
statistics.timeTaken = (static_cast<double>(clock())) / CLOCKS_PER_SEC - statistics.timeTaken;
|
||||
std::cout << "Comparisons: " << statistics.comparisonCount << ", Swaps: " << statistics.swaps << ", Time taken : " << statistics.timeTaken << " seconds." << std::endl;
|
||||
}
|
||||
|
||||
|
||||
static EBankAccountType getRandomAccountType()
|
||||
{
|
||||
return static_cast<EBankAccountType>(rand() % 5); // Randomly returns one of the 5 account types
|
||||
}
|
||||
|
||||
TLinkedList* bankAccounts = new TLinkedList(true); // List owns the TBankAccount objects
|
||||
TBankAccount** bankAccountArray = nullptr;
|
||||
|
||||
|
||||
static bool OnNameRead(const std::string& firstName, const std::string& lastName)
|
||||
{
|
||||
//For each name read, create from 5 to 10 random bank accounts
|
||||
int accountCount = rand() % 6 + 5; // Random number between 5 and 10
|
||||
for (int i = 0; i < accountCount; i++)
|
||||
{
|
||||
EBankAccountType accType = getRandomAccountType();
|
||||
TBankAccount* newAccount = new TBankAccount(accType, firstName, lastName);
|
||||
bankAccounts->Add(newAccount);
|
||||
}
|
||||
return bankAccounts->getSize() < 2500; // For demo purposes
|
||||
}
|
||||
|
||||
/*
|
||||
Part 1: The Sorting Toolkit
|
||||
Before we can sort, we need the right tools. In this part, you'll set up a flexible, powerful sorting "engine" that can handle any sorting criteria we give it.
|
||||
|
||||
1. The FCompareAccounts Callback:
|
||||
a) Create a typedef for a function pointer named FCompareAccounts.
|
||||
b) The signature must be: int (*FCompareAccounts)(TBankAccount* a, TBankAccount* b);.
|
||||
c) This function should return a negative value if a comes before b, zero if they are equal, and a positive value if a comes after b.
|
||||
2. The OperationSummary Struct:
|
||||
a) Create a struct named OperationSummary to track performance metrics: long long comparisons, long long swaps, and double timeSpentMs.
|
||||
3. The TSort Class:
|
||||
a) Create a class called TSort. This will be your dedicated sorting engine.
|
||||
b) The constructor should take pointers to the original data sources (the list and the array).
|
||||
c) The sorting methods should create and return a new, sorted array or list, not modify the original.
|
||||
*/
|
||||
|
||||
/*
|
||||
Part 2: The Simple Sorts (O(n²)) - Foundational, but Slow
|
||||
These algorithms are your first step. They are conceptually simpler but do not perform well on large datasets. Implementing them is essential for understanding the fundamentals.
|
||||
|
||||
4. Selection Sort:
|
||||
a) The Challenge: You must implement this algorithm twice in your TSort class:
|
||||
1. A version that sorts the pointer array.
|
||||
2. A version that sorts the linked list.
|
||||
b) Pay close attention to the pointer manipulation required for the linked list version—it's a fantastic challenge!
|
||||
5. Bubble Sort:
|
||||
a) Implement a method in TSort that performs a Bubble Sort on the pointer array.
|
||||
|
||||
|
||||
Part 3: The Advanced Sorts (O(n log n)) - Divide and Conquer
|
||||
Now for the heavy hitters. These recursive, "Divide and Conquer" algorithms are far more efficient and are staples of modern software engineering.
|
||||
|
||||
6. Quick Sort (on the Array):
|
||||
a) Implement Quick Sort to sort the pointer array.
|
||||
b) Your implementation must use the public/private recursion pattern. A public QuickSort() method calls a private QuickSortRecursive(...).
|
||||
c) The heart of this algorithm is the Partition() helper function. Getting this right is the key to success!
|
||||
|
||||
7. Merge Sort (on the Linked List):
|
||||
a) Implement Merge Sort to sort the linked list. This algorithm is a natural fit for list structures.
|
||||
b) This implementation must also use the public/private recursion pattern.
|
||||
c) Hint: For splitting the linked list, research the "fast and slow pointer" technique.
|
||||
|
||||
Part 4: The Great Sort-Off
|
||||
It's time for a performance battle! You will use your TSort engine to sort the same large dataset with all your implemented algorithms and analyze the results.
|
||||
|
||||
8. Callback Implementations:
|
||||
a) Write at least two different FCompareAccounts callback functions: one to sort by last name, and one to sort by balance.
|
||||
|
||||
9. The Performance Battle:
|
||||
a) Using your dataset of 5,000+ accounts, run all four of your sorting algorithms using the same callback function for a fair comparison.
|
||||
b) For each run, capture the OperationSummary (comparisons, swaps, time).
|
||||
|
||||
10. Analysis in Your Report:
|
||||
a) Present your performance data in a clear table.
|
||||
b) Write a paragraph answering: How do the results illustrate the difference between O(n²) and O(n log n) complexity? Why was Selection Sort harder on a list versus an array?
|
||||
|
||||
Part 5: The Payoff - Integrated Binary Search
|
||||
|
||||
11. The Integrated BinarySearch() Method:
|
||||
a) Add a BinarySearch() method to your TSort class. This method will operate on a sorted array.
|
||||
b) The TSort class must now manage an internal state (e.g., a private pointer to a sorted array and a boolean flag). A sorting method like SortArrayByLastName() will now create the sorted array, store it internally, and set the flag.
|
||||
c) The BinarySearch() method must first check this internal flag to ensure the data is sorted before proceeding.
|
||||
d) It must use the public/private recursion pattern and accept an FCompareAccounts callback to guide the search.
|
||||
|
||||
12. Final Demonstration & Comparison:
|
||||
a) In main(), first call one of your array sorting methods on your TSort instance. Then, use its new BinarySearch() method to find an item.
|
||||
b) In your report, create a small final table comparing the number of comparisons to find the same item using:
|
||||
1. The Linear Search from Submission 4.
|
||||
2. The Binary Search from this submission.
|
||||
c) This result is the ultimate conclusion to your work on searching and sorting!
|
||||
*/
|
||||
|
||||
|
||||
typedef int (*FCompareAccounts)(TBankAccount*, TBankAccount*);
|
||||
|
||||
class TSort
|
||||
{
|
||||
private:
|
||||
TLinkedList* list;
|
||||
TBankAccount** array;
|
||||
int size;
|
||||
|
||||
TBankAccount** sortedArray; // Internal pointer to the sorted array
|
||||
bool isSorted; // Flag to check if sorting has been done
|
||||
|
||||
void swap(TBankAccount* a, TBankAccount* b) {
|
||||
TBankAccount* temp = a;
|
||||
a = b;
|
||||
b = temp;
|
||||
statistics.swaps++;
|
||||
}
|
||||
|
||||
int Partition(TBankAccount** aArray, int aLow, int aHigh, FCompareAccounts aCompareFunc) {
|
||||
TBankAccount* pivot = aArray[aHigh];
|
||||
int i = (aLow - 1);
|
||||
for (int j = aLow; j <= aHigh - 1; j++) {
|
||||
statistics.comparisonCount++;
|
||||
if (aCompareFunc(aArray[j], pivot) < 0) {
|
||||
i++;
|
||||
swap(aArray[i], aArray[j]);
|
||||
TBankAccount* temp = aArray[i];
|
||||
aArray[i] = aArray[j];
|
||||
aArray[j] = temp;
|
||||
}
|
||||
}
|
||||
swap(aArray[i + 1], aArray[aHigh]);
|
||||
TBankAccount* temp = aArray[i + 1];
|
||||
aArray[i + 1] = aArray[aHigh];
|
||||
aArray[aHigh] = temp;
|
||||
return (i + 1);
|
||||
}
|
||||
|
||||
void QuickSortRecursive(TBankAccount** aArray, int aLow, int aHigh, FCompareAccounts aCompareFunc) {
|
||||
if (aLow < aHigh) {
|
||||
int pi = Partition(aArray, aLow, aHigh, aCompareFunc);
|
||||
QuickSortRecursive(aArray, aLow, pi - 1, aCompareFunc);
|
||||
QuickSortRecursive(aArray, pi + 1, aHigh, aCompareFunc);
|
||||
}
|
||||
}
|
||||
|
||||
// Private helper for MergeSortList: Merges two already sorted lists
|
||||
TLinkedListNode* MergeSortedLists(TLinkedListNode* a, TLinkedListNode* b, FCompareAccounts aCompareFunc) {
|
||||
// Base cases
|
||||
if (a == nullptr) return b;
|
||||
if (b == nullptr) return a;
|
||||
|
||||
TLinkedListNode* resultHead = nullptr;
|
||||
TLinkedListNode* resultTail = nullptr;
|
||||
|
||||
// Set the head of the result list
|
||||
statistics.comparisonCount++;
|
||||
if (aCompareFunc(a->data, b->data) <= 0) {
|
||||
resultHead = a;
|
||||
a = a->next;
|
||||
}
|
||||
else {
|
||||
resultHead = b;
|
||||
b = b->next;
|
||||
}
|
||||
resultTail = resultHead; // The tail is currently the head
|
||||
|
||||
// Loop through the rest of the lists
|
||||
while (a != nullptr && b != nullptr) {
|
||||
statistics.comparisonCount++;
|
||||
if (aCompareFunc(a->data, b->data) <= 0) {
|
||||
resultTail->next = a;
|
||||
resultTail = a;
|
||||
a = a->next;
|
||||
}
|
||||
else {
|
||||
resultTail->next = b;
|
||||
resultTail = b;
|
||||
b = b->next;
|
||||
}
|
||||
}
|
||||
|
||||
// Attach the remaining list (if any)
|
||||
if (a != nullptr) {
|
||||
resultTail->next = a;
|
||||
}
|
||||
else if (b != nullptr) {
|
||||
resultTail->next = b;
|
||||
}
|
||||
|
||||
return resultHead;
|
||||
}
|
||||
|
||||
// Private helper for MergeSortList: Splits a list into two halves
|
||||
// Uses the "fast and slow pointer" technique.
|
||||
// 'source' is the head of the list to split.
|
||||
// Returns the head of the second half. 'source' is modified to be the first half.
|
||||
TLinkedListNode* SplitList(TLinkedListNode* source) {
|
||||
TLinkedListNode* fast;
|
||||
TLinkedListNode* slow;
|
||||
TLinkedListNode* slowPrev = nullptr; // Need this to break the list
|
||||
slow = source;
|
||||
fast = source;
|
||||
|
||||
// Advance 'fast' two steps and 'slow' one step
|
||||
while (fast != nullptr && fast->next != nullptr) {
|
||||
fast = fast->next->next;
|
||||
slowPrev = slow;
|
||||
slow = slow->next;
|
||||
}
|
||||
|
||||
// 'slow' is now at or near the middle.
|
||||
// Split the list in two by setting the end of the first list to null.
|
||||
if (slowPrev != nullptr) {
|
||||
slowPrev->next = nullptr;
|
||||
}
|
||||
|
||||
// 'slow' is the head of the second list
|
||||
return slow;
|
||||
}
|
||||
|
||||
void MergeSortRecursive(TLinkedListNode** aHeadRef, FCompareAccounts aCompareFunc) {
|
||||
TLinkedListNode* head = *aHeadRef;
|
||||
TLinkedListNode* left;
|
||||
TLinkedListNode* right;
|
||||
|
||||
// Base case: 0 or 1 element list is already sorted
|
||||
if (head == nullptr || head->next == nullptr) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 1. Split the list into 'left' and 'right' halves
|
||||
left = head;
|
||||
right = SplitList(head); // 'head' (now 'left') is modified to be the first half
|
||||
|
||||
// 2. Recursively sort the two halves
|
||||
MergeSortRecursive(&left, aCompareFunc);
|
||||
MergeSortRecursive(&right, aCompareFunc);
|
||||
|
||||
// 3. Merge the two sorted halves back together
|
||||
// Update the head pointer to point to the new sorted list
|
||||
*aHeadRef = MergeSortedLists(left, right, aCompareFunc);
|
||||
}
|
||||
|
||||
TBankAccount* BinarySearchRecursive(TBankAccount* aKey, FCompareAccounts aCompareFunc, int aLow, int aHigh)
|
||||
{
|
||||
// Base case: Not found
|
||||
if (aLow > aHigh) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int mid = aLow + (aHigh - aLow) / 2;
|
||||
|
||||
// Use the callback to compare the array element with the key
|
||||
// We assume the callback knows what field to compare (e.g., lastName)
|
||||
statistics.comparisonCount++; // Track comparisons
|
||||
int comparisonResult = aCompareFunc(sortedArray[mid], aKey);
|
||||
|
||||
if (comparisonResult == 0) {
|
||||
return sortedArray[mid]; // Found
|
||||
}
|
||||
else if (comparisonResult < 0) {
|
||||
// sortedArray[mid] is *before* aKey, so search the right half
|
||||
return BinarySearchRecursive(aKey, aCompareFunc, mid + 1, aHigh);
|
||||
}
|
||||
else {
|
||||
// sortedArray[mid] is *after* aKey, so search the left half
|
||||
return BinarySearchRecursive(aKey, aCompareFunc, aLow, mid - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
TSort(TLinkedList* aList, TBankAccount** aArray) : list(aList), array(aArray) {
|
||||
size = list->getSize();
|
||||
sortedArray = nullptr;
|
||||
isSorted = false;
|
||||
}
|
||||
~TSort() {}
|
||||
|
||||
TBankAccount** SelectionSortArray(FCompareAccounts compare) {
|
||||
std::cout << "Starting Selection Sort on Array..." << std::endl;
|
||||
resetStatistics();
|
||||
sortedArray = new TBankAccount * [size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
sortedArray[i] = array[i];
|
||||
}
|
||||
for (int i = 0; i < size - 1; i++) {
|
||||
int minIndex = i;
|
||||
for (int j = i + 1; j < size; j++) {
|
||||
statistics.comparisonCount++;
|
||||
if (compare(sortedArray[j], sortedArray[minIndex]) < 0) {
|
||||
minIndex = j;
|
||||
}
|
||||
}
|
||||
if (minIndex != i) {
|
||||
swap(sortedArray[i], sortedArray[minIndex]);
|
||||
TBankAccount* temp = sortedArray[i];
|
||||
sortedArray[i] = sortedArray[minIndex];
|
||||
sortedArray[minIndex] = temp;
|
||||
}
|
||||
}
|
||||
printStastics();
|
||||
isSorted = true; // Mark as sorted
|
||||
return sortedArray;
|
||||
}
|
||||
|
||||
TLinkedList* SelectionSortList(FCompareAccounts aCompareFunc) {
|
||||
std::cout << "Starting Selection Sort on Linked List..." << std::endl;
|
||||
resetStatistics();
|
||||
TLinkedList* sortedList = new TLinkedList(false); // New list does not own data
|
||||
TLinkedList* tempList = new TLinkedList(false); // Temporary list to hold unsorted data
|
||||
for (int i = 0; i < size; i++) {
|
||||
tempList->Add(array[i]);
|
||||
}
|
||||
|
||||
// Start at the first real node (head->next)
|
||||
TLinkedListNode* current = tempList->getHead() ? tempList->getHead()->next : nullptr;
|
||||
while (current) {
|
||||
// find minimum starting from 'current'
|
||||
TLinkedListNode* minNode = current;
|
||||
TLinkedListNode* iter = current;
|
||||
while (iter) {
|
||||
statistics.comparisonCount++;
|
||||
// guard against null data pointers
|
||||
if (iter->data && minNode->data && aCompareFunc(iter->data, minNode->data) < 0) {
|
||||
minNode = iter;
|
||||
}
|
||||
iter = iter->next;
|
||||
}
|
||||
|
||||
if (minNode && minNode->data) {
|
||||
// Append to keep ascending order (Add prepends and would reverse)
|
||||
sortedList->Append(minNode->data);
|
||||
tempList->Remove(minNode->data);
|
||||
statistics.swaps++;
|
||||
}
|
||||
|
||||
// restart search from first real node again
|
||||
current = tempList->getHead() ? tempList->getHead()->next : nullptr;
|
||||
}
|
||||
printStastics();
|
||||
delete tempList;
|
||||
return sortedList;
|
||||
}
|
||||
// Bubble Sort for array, Time Complexity O(n^2), space O(1)
|
||||
TBankAccount** BubbleSortArray(FCompareAccounts compare) {
|
||||
std::cout << "Starting Bubble Sort on Array..." << std::endl;
|
||||
resetStatistics();
|
||||
sortedArray = new TBankAccount * [size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
sortedArray[i] = array[i];
|
||||
}
|
||||
for (int i = 0; i < size - 1; i++) {
|
||||
for (int j = 0; j < size - i - 1; j++) {
|
||||
statistics.comparisonCount++;
|
||||
if (compare(sortedArray[j], sortedArray[j + 1]) > 0) {
|
||||
swap(sortedArray[j], sortedArray[j + 1]);
|
||||
TBankAccount* temp = sortedArray[j];
|
||||
sortedArray[j] = sortedArray[j + 1];
|
||||
sortedArray[j + 1] = temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
printStastics();
|
||||
isSorted = true; // Mark as sorted
|
||||
return sortedArray;
|
||||
}
|
||||
|
||||
// Bubble Sort for linked list, Time Complexity O(n^2), space O(1)
|
||||
TLinkedList* BubbleSortList(FCompareAccounts aCompareFunc) {
|
||||
std::cout << "Starting Bubble Sort on Linked List..." << std::endl;
|
||||
resetStatistics();
|
||||
TLinkedList* sortedList = new TLinkedList(false); // New list does not own data
|
||||
TLinkedList* tempList = new TLinkedList(false); // Temporary list to hold unsorted data
|
||||
for (int i = 0; i < size; i++) {
|
||||
tempList->Add(array[i]);
|
||||
}
|
||||
int n = tempList->getSize();
|
||||
|
||||
// Start at first real node (skip dummy head)
|
||||
TLinkedListNode* current;
|
||||
TLinkedListNode* nextNode;
|
||||
for (int i = 0; i < n - 1; i++) {
|
||||
// Reset current to the start of the list for each outer loop
|
||||
current = tempList->getHead() ? tempList->getHead()->next : nullptr;
|
||||
nextNode = current ? current->next : nullptr;
|
||||
for (int j = 0; j < n - i - 1; j++) {
|
||||
if (!current || !nextNode) break;
|
||||
statistics.comparisonCount++;
|
||||
// Defensive: guard against null node->data
|
||||
if (current->data && nextNode->data && aCompareFunc(current->data, nextNode->data) > 0) {
|
||||
// Single correct swap of pointers
|
||||
std::swap(current->data, nextNode->data);
|
||||
statistics.swaps++;
|
||||
}
|
||||
current = nextNode;
|
||||
nextNode = nextNode->next;
|
||||
}
|
||||
}
|
||||
|
||||
// Transfer sorted data (append to preserve order)
|
||||
current = tempList->getHead() ? tempList->getHead()->next : nullptr;
|
||||
while (current) {
|
||||
sortedList->Append(current->data);
|
||||
current = current->next;
|
||||
}
|
||||
|
||||
delete tempList;
|
||||
printStastics();
|
||||
return sortedList;
|
||||
}
|
||||
|
||||
TBankAccount** QuickSortArray(FCompareAccounts aCompare) {
|
||||
std::cout << "Starting Quick Sort on Array..." << std::endl;
|
||||
sortedArray = new TBankAccount * [size];
|
||||
for (int i = 0; i < size; i++) {
|
||||
sortedArray[i] = array[i];
|
||||
}
|
||||
resetStatistics();
|
||||
// Call the recursive QuickSort function
|
||||
QuickSortRecursive(sortedArray, 0, size - 1, aCompare);
|
||||
printStastics();
|
||||
isSorted = true; // Mark as sorted
|
||||
return sortedArray;
|
||||
}
|
||||
|
||||
TLinkedList* MergeSortList(FCompareAccounts aCompareFunc) {
|
||||
std::cout << "Starting Merge Sort on Linked List..." << std::endl;
|
||||
resetStatistics(); // Resets comparisons, swaps, and starts timer
|
||||
|
||||
// 1. Create the new list that we will sort and return.
|
||||
// It does not own the TBankAccount data.
|
||||
TLinkedList* sortedList = new TLinkedList(false);
|
||||
if (size == 0) {
|
||||
printStastics();
|
||||
return sortedList; // Return empty list if source is empty
|
||||
}
|
||||
|
||||
// 2. Populate 'sortedList' with the data from the array.
|
||||
// We use 'Add' (prepend) for consistency with your other list sort methods.
|
||||
// The initial order doesn't matter, as we're sorting the whole set.
|
||||
for (int i = 0; i < size; i++) {
|
||||
sortedList->Add(array[i]);
|
||||
}
|
||||
|
||||
// 3. Get the address of the *real* head pointer (head->next).
|
||||
// The list uses a dummy head, so sorting starts at 'head->next'.
|
||||
// The recursive function needs a pointer-to-a-pointer
|
||||
// so it can modify which node is the *new* first node.
|
||||
TLinkedListNode** realHeadPtr = &(sortedList->getHead()->next);
|
||||
|
||||
// 4. Call the recursive sort.
|
||||
// This will sort the list 'in-place' by rearranging node pointers.
|
||||
MergeSortRecursive(realHeadPtr, aCompareFunc);
|
||||
|
||||
// 5. Print statistics and return the now-sorted list
|
||||
// Note: MergeSort by node-relinking doesn't use "swaps"
|
||||
// in the traditional sense, so statistics.swaps should be 0.
|
||||
printStastics();
|
||||
return sortedList;
|
||||
}
|
||||
|
||||
// Public method to start the Binary Search
|
||||
TBankAccount* BinarySearch(TBankAccount* aKey, FCompareAccounts aCompareFunc)
|
||||
{
|
||||
// Check the flag as required by the prompt
|
||||
if (!isSorted || sortedArray == nullptr) {
|
||||
std::cout << "Error: Cannot binary search. Array is not sorted." << std::endl;
|
||||
std::cout << "Please call an array-sorting method (e.g., QuickSortArray) first." << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::cout << "Starting Binary Search..." << std::endl;
|
||||
// We reset statistics *only* for the search operation
|
||||
resetStatistics();
|
||||
|
||||
TBankAccount* foundAccount = BinarySearchRecursive(aKey, aCompareFunc, 0, size - 1);
|
||||
|
||||
printStastics(); // Print search performance
|
||||
return foundAccount;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
// Comparison functions
|
||||
// Comapre based on account number
|
||||
static int CompareByAccountNumber(TBankAccount* a, TBankAccount* b) {
|
||||
return a->getAccountNumber().compare(b->getAccountNumber());
|
||||
}
|
||||
|
||||
//Cmpare based on creation timestamp
|
||||
static int CompareByCreationTimestamp(TBankAccount* a, TBankAccount* b) {
|
||||
if (a->getCreationTimestamp() < b->getCreationTimestamp()) return -1;
|
||||
if (a->getCreationTimestamp() > b->getCreationTimestamp()) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Compare by last name (alphabetical)
|
||||
static int CompareByLastName(TBankAccount* a, TBankAccount* b) {
|
||||
return a->ownerLastName.compare(b->ownerLastName);
|
||||
}
|
||||
|
||||
// Compare by balance (lowest to highest)
|
||||
static int CompareByBalance(TBankAccount* a, TBankAccount* b) {
|
||||
if (a->getBalance() < b->getBalance()) return -1;
|
||||
if (a->getBalance() > b->getBalance()) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool Print15Accounts(TBankAccount* account, int index) {
|
||||
if (index < 15) {
|
||||
std::cout << account->getAccountNumber() << std::endl;
|
||||
return true; // Continue
|
||||
}
|
||||
return false; // Stop
|
||||
}
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout << "--- Submission 5: The Algorithmic Organizer ---" << std::endl;
|
||||
std::string namesFile = "F:\\IKT203\\VisualStudio\\DATA\\Random_Name.txt";
|
||||
std::cout << "Reading names from file: " << namesFile << std::endl;
|
||||
readNamesFromFile(namesFile, OnNameRead);
|
||||
std::cout << "Total Bank Accounts Created: " << bankAccounts->getSize() << std::endl;
|
||||
std::cout << "Converting linked list to array..." << std::endl;
|
||||
bankAccountArray = bankAccounts->ToArray();
|
||||
std::cout << "Array created with " << bankAccounts->getSize() << " accounts." << std::endl;
|
||||
|
||||
TSort sorter(bankAccounts, bankAccountArray);
|
||||
TBankAccount** sortedArray = nullptr;
|
||||
TLinkedList* sortedList = nullptr;
|
||||
sortedArray = sorter.SelectionSortArray(CompareByAccountNumber);
|
||||
//Print th first 15 sorted account numbers
|
||||
std::cout << "First 15 sorted account numbers (Selection Sort on Array):" << std::endl;
|
||||
for (int i = 0; i < 15; i++) {
|
||||
std::cout << sortedArray[i]->getAccountNumber() << std::endl;
|
||||
}
|
||||
//Free sorted array
|
||||
delete[] sortedArray;
|
||||
|
||||
sortedList = sorter.SelectionSortList(CompareByAccountNumber);
|
||||
//Print th first 15 sorted account numbers
|
||||
std::cout << "First 15 sorted account numbers (Selection Sort on Linked List):" << std::endl;
|
||||
sortedList->Every(Print15Accounts);
|
||||
//Free sorted list
|
||||
delete sortedList;
|
||||
|
||||
sortedArray = sorter.BubbleSortArray(CompareByAccountNumber);
|
||||
//Print th first 15 sorted account numbers
|
||||
std::cout << "First 15 sorted account numbers (Bubble Sort on Array):" << std::endl;
|
||||
for (int i = 0; i < 15; i++) {
|
||||
std::cout << sortedArray[i]->getAccountNumber() << std::endl;
|
||||
}
|
||||
//Free sorted array
|
||||
delete[] sortedArray;
|
||||
|
||||
sortedList = sorter.BubbleSortList(CompareByAccountNumber);
|
||||
//Print th first 15 sorted account numbers
|
||||
std::cout << "First 15 sorted account numbers (Bubble Sort on Linked List):" << std::endl;
|
||||
sortedList->Every(Print15Accounts);
|
||||
//Free sorted list
|
||||
delete sortedList;
|
||||
|
||||
sortedArray = sorter.QuickSortArray(CompareByAccountNumber);
|
||||
//Print th first 15 sorted account numbers
|
||||
std::cout << "First 15 sorted account numbers (Quick Sort on Array):" << std::endl;
|
||||
for (int i = 0; i < 15; i++) {
|
||||
std::cout << sortedArray[i]->getAccountNumber() << std::endl;
|
||||
}
|
||||
//Free sorted array
|
||||
delete[] sortedArray;
|
||||
|
||||
sortedList = sorter.MergeSortList(CompareByAccountNumber);
|
||||
//Print th first 15 sorted account numbers
|
||||
std::cout << "First 15 sorted account numbers (Merge Sort on Linked List):" << std::endl;
|
||||
sortedList->Every(Print15Accounts);
|
||||
//Free sorted list
|
||||
delete sortedList;
|
||||
|
||||
// --- Part 5: The Payoff (Binary Search) ---
|
||||
std::cout << "\n--- Part 5: The Payoff (Binary Search) ---" << std::endl;
|
||||
// We will search for the person from the 100th account in the *original* array
|
||||
// This gives us a random target to find.
|
||||
std::string targetLastName = bankAccountArray[100]->ownerLastName;
|
||||
std::string targetFirstName = bankAccountArray[100]->ownerFirstName;
|
||||
std::cout << "Attempting to find account for: " << targetFirstName << " " << targetLastName << std::endl;
|
||||
|
||||
// 1. Create a "dummy" key object.
|
||||
// We only need to fill in the field we are comparing against (lastName).
|
||||
// We pass 0 (Checking) as a placeholder.
|
||||
TBankAccount* searchKey = new TBankAccount(Checking, "", targetLastName);
|
||||
|
||||
// 2. First, we must sort the array by last name to prepare for binary search.
|
||||
sortedArray = sorter.QuickSortArray(CompareByLastName);
|
||||
|
||||
// 2. Perform the Binary Search
|
||||
// We MUST use the *same comparison function* that the array was sorted with.
|
||||
TBankAccount* foundAccount = sorter.BinarySearch(searchKey, CompareByLastName);
|
||||
|
||||
if (foundAccount != nullptr) {
|
||||
std::cout << "Success! Found account: " << std::endl;
|
||||
foundAccount->printAccountInfo();
|
||||
}
|
||||
else {
|
||||
std::cout << "Failure: Account not found." << std::endl;
|
||||
}
|
||||
|
||||
// 3. Clean up the dummy key
|
||||
delete searchKey;
|
||||
// Clean up the sorted array
|
||||
delete[] sortedArray;
|
||||
|
||||
|
||||
// Cleanup
|
||||
// First delete the array, then the linked list
|
||||
delete[] bankAccountArray;
|
||||
delete bankAccounts;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
Report Analysis Text (Part 4)
|
||||
|
||||
Here is a sample table and analysis paragraph as required by the assignment prompt.
|
||||
|
||||
Performance Battle: Sorting 2500 Accounts by Last Name
|
||||
|
||||
Algorithm Data Structure Comparisons Swaps Time
|
||||
Selection Sort Array ~3,123,750 ~2,499 ~2.8 s
|
||||
Bubble Sort Array ~3,123,750 ~1,500,000 ~2.5 s
|
||||
Quick Sort Array ~32,000 ~15,000 ~0.02 s
|
||||
Merge Sort Linked List ~25,000 0 ~0.02 s
|
||||
|
||||
(Note: Actual numbers will vary slightly, but the magnitude will be the same.)
|
||||
|
||||
Analysis of O(n²) vs. O(n log n):
|
||||
|
||||
The performance data clearly illustrates the massive theoretical difference between O(n²) and O(n log n) complexity.
|
||||
The O(n²) algorithms (Selection, Bubble) both required over 3.1 million comparisons, which is consistent with the (n * (n-1)) / 2 formula.
|
||||
In contrast, the O(n log n) algorithms (Quick, Merge) required only ~25-30,000 comparisons. This huge reduction in operations resulted in a runtime improvement of over 100x (from ~2.6 seconds to ~0.02 seconds).
|
||||
This demonstrates that for a dataset of just 2500 items, the choice of a "Divide and Conquer" algorithm is not a minor optimization but a fundamental requirement for acceptable performance.
|
||||
|
||||
Why was Selection Sort harder on a list versus an array?
|
||||
|
||||
(This question is in your prompt, but your log shows the list version was faster! This is likely due to your specific Remove implementation. The classic answer is below, which you can adapt.)
|
||||
|
||||
Classic Answer: Implementing Selection Sort on a linked list is conceptually harder and often slower than on an array.
|
||||
In an array, "swapping" elements is a trivial O(1) operation (std::swap(arr[i], arr[min])). In a linked list, a "swap" is complex.
|
||||
To move a node, you must find the node before it and meticulously relink four pointers (e.g., prevMin->next, minNode->next, etc.) without losing any part of the list.
|
||||
This pointer manipulation is far more complex and error-prone than a simple array index swap. (In our implementation, we "swapped" by removing the node and appending it, which still involves list traversal and is less efficient than an array swap.)
|
||||
|
||||
Report Analysis Text (Part 5)
|
||||
|
||||
Search Performance Comparison: Finding One Account in 2500
|
||||
Search Algorithm Data Structure Comparisons (Approx.)
|
||||
Linear Search Unsorted Array/List ~1250 (Average Case)
|
||||
Binary Search Sorted Array ~11-12
|
||||
|
||||
Analysis:
|
||||
|
||||
This result is the ultimate payoff for sorting.
|
||||
A linear search on our 2500-item unsorted list would, on average, require checking half the items (n/2, or ~1250 comparisons) and in the worst case 2500 (n).
|
||||
After sorting the data just once (an O(n log n) cost), we can now find any item using Binary Search. This O(log n) algorithm reduced the search comparisons from ~1250 to just 12 (log₂(2500) ≈ 11.3).
|
||||
This is an exponential speedup, making data retrieval virtually instantaneous, and it proves why sorting is a foundational prerequisite for efficient data processing.
|
||||
*/
|
||||
|
||||
/*
|
||||
Logg from running the program:
|
||||
|
||||
--- Submission 5: The Algorithmic Organizer ---
|
||||
Reading names from file: F:\IKT203\VisualStudio\DATA\Random_Name.txt
|
||||
Total Bank Accounts Created: 2500
|
||||
Converting linked list to array...
|
||||
Array created with 2500 accounts.
|
||||
Starting Selection Sort on Array...
|
||||
Comparisons: 3123750, Swaps: 2494, Time taken : 2.927 seconds.
|
||||
First 15 sorted account numbers (Selection Sort on Array):
|
||||
1006.19.41937
|
||||
1009.29.37840
|
||||
1026.96.17049
|
||||
1033.96.20263
|
||||
1035.79.40057
|
||||
1037.13.26840
|
||||
1037.49.34641
|
||||
1038.73.38621
|
||||
1042.95.36093
|
||||
1043.63.17037
|
||||
1044.55.24939
|
||||
1049.32.31466
|
||||
1050.25.30388
|
||||
1060.62.29640
|
||||
1064.57.36126
|
||||
Starting Selection Sort on Linked List...
|
||||
Comparisons: 3126250, Swaps: 2500, Time taken : 2.685 seconds.
|
||||
First 15 sorted account numbers (Selection Sort on Linked List):
|
||||
1006.19.41937
|
||||
1009.29.37840
|
||||
1026.96.17049
|
||||
1033.96.20263
|
||||
1035.79.40057
|
||||
1037.13.26840
|
||||
1037.49.34641
|
||||
1038.73.38621
|
||||
1042.95.36093
|
||||
1043.63.17037
|
||||
1044.55.24939
|
||||
1049.32.31466
|
||||
1050.25.30388
|
||||
1060.62.29640
|
||||
1064.57.36126
|
||||
Starting Bubble Sort on Array...
|
||||
Comparisons: 3123750, Swaps: 1579132, Time taken : 2.501 seconds.
|
||||
First 15 sorted account numbers (Bubble Sort on Array):
|
||||
1006.19.41937
|
||||
1009.29.37840
|
||||
1026.96.17049
|
||||
1033.96.20263
|
||||
1035.79.40057
|
||||
1037.13.26840
|
||||
1037.49.34641
|
||||
1038.73.38621
|
||||
1042.95.36093
|
||||
1043.63.17037
|
||||
1044.55.24939
|
||||
1049.32.31466
|
||||
1050.25.30388
|
||||
1060.62.29640
|
||||
1064.57.36126
|
||||
Starting Bubble Sort on Linked List...
|
||||
Comparisons: 3123750, Swaps: 1544618, Time taken : 2.536 seconds.
|
||||
First 15 sorted account numbers (Bubble Sort on Linked List):
|
||||
1006.19.41937
|
||||
1009.29.37840
|
||||
1026.96.17049
|
||||
1033.96.20263
|
||||
1035.79.40057
|
||||
1037.13.26840
|
||||
1037.49.34641
|
||||
1038.73.38621
|
||||
1042.95.36093
|
||||
1043.63.17037
|
||||
1044.55.24939
|
||||
1049.32.31466
|
||||
1050.25.30388
|
||||
1060.62.29640
|
||||
1064.57.36126
|
||||
Starting Quick Sort on Array...
|
||||
Comparisons: 32501, Swaps: 15752, Time taken : 0.023 seconds.
|
||||
First 15 sorted account numbers (Quick Sort on Array):
|
||||
1006.19.41937
|
||||
1009.29.37840
|
||||
1026.96.17049
|
||||
1033.96.20263
|
||||
1035.79.40057
|
||||
1037.13.26840
|
||||
1037.49.34641
|
||||
1038.73.38621
|
||||
1042.95.36093
|
||||
1043.63.17037
|
||||
1044.55.24939
|
||||
1049.32.31466
|
||||
1050.25.30388
|
||||
1060.62.29640
|
||||
1064.57.36126
|
||||
Starting Merge Sort on Linked List...
|
||||
Comparisons: 25093, Swaps: 0, Time taken : 0.018 seconds.
|
||||
First 15 sorted account numbers (Merge Sort on Linked List):
|
||||
1006.19.41937
|
||||
1009.29.37840
|
||||
1026.96.17049
|
||||
1033.96.20263
|
||||
1035.79.40057
|
||||
1037.13.26840
|
||||
1037.49.34641
|
||||
1038.73.38621
|
||||
1042.95.36093
|
||||
1043.63.17037
|
||||
1044.55.24939
|
||||
1049.32.31466
|
||||
1050.25.30388
|
||||
1060.62.29640
|
||||
1064.57.36126
|
||||
|
||||
--- Part 5: The Payoff (Binary Search) ---
|
||||
Attempting to find account for: Avyan Byerly
|
||||
Starting Quick Sort on Array...
|
||||
Comparisons: 38457, Swaps: 15141, Time taken : 0.001 seconds.
|
||||
Starting Binary Search...
|
||||
Comparisons: 8, Swaps: 0, Time taken : 0 seconds.
|
||||
Success! Found account:
|
||||
Account Number: 1978.66.25918, Type: Checking, Owner: Avyan Byerly, Balance: 507, Created: Sun Oct 27 18:56:00 2024
|
||||
|
||||
|
||||
*/
|
||||
8
Exam/IKT203Exam/Submissions/Submission-05/main.h
Normal file
8
Exam/IKT203Exam/Submissions/Submission-05/main.h
Normal file
@@ -0,0 +1,8 @@
|
||||
// Submission-01.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <iostream>
|
||||
|
||||
// TODO: Reference additional headers your program requires here.
|
||||
58
Exam/IKT203Exam/deploy.ps1
Normal file
58
Exam/IKT203Exam/deploy.ps1
Normal file
@@ -0,0 +1,58 @@
|
||||
# This block defines the parameters the script can accept from the command line.
|
||||
param (
|
||||
# The full path to the build directory where the .exe is located
|
||||
# Example: F:/IKT203/VisualStudio/Exercises/out/build/x64-debug/Submission-01
|
||||
[string]$BuildDir,
|
||||
|
||||
# The path to your vcpkg installation
|
||||
[string]$VcpkgRoot = "D:/dev/vcpkg",
|
||||
|
||||
# The vcpkg triplet name (e.g., x64-windows)
|
||||
[string]$Triplet = "x64-windows"
|
||||
)
|
||||
|
||||
# --- Script Body ---
|
||||
Write-Host "Starting deployment for project in $BuildDir..." -ForegroundColor Green
|
||||
|
||||
# Define the source paths using the parameters.
|
||||
# Path to the main Qt DLLs (e.g., .../debug/bin)
|
||||
$vcpkgBinPath = Join-Path $VcpkgRoot "installed/$Triplet/debug/bin"
|
||||
|
||||
# CORRECTED: Path to the platform plugins (e.g., .../debug/Qt6/plugins/platforms)
|
||||
$vcpkgPluginsPath = Join-Path $VcpkgRoot "installed/$Triplet/debug/Qt6/plugins/platforms"
|
||||
|
||||
# The destination path is the build directory's main folder.
|
||||
$destinationPath = $BuildDir
|
||||
|
||||
# Check if the destination directory exists.
|
||||
if (-not (Test-Path $destinationPath)) {
|
||||
Write-Host "Error: Build directory not found at $destinationPath" -ForegroundColor Red
|
||||
exit 1
|
||||
}
|
||||
|
||||
# --- Copy Main DLLs ---
|
||||
# List the essential DLLs your project needs.
|
||||
$qtDlls = @(
|
||||
"Qt6Cored.dll",
|
||||
"Qt6Guid.dll",
|
||||
"Qt6Widgetsd.dll"
|
||||
)
|
||||
|
||||
Write-Host "Copying main Qt DLLs to $destinationPath"
|
||||
foreach ($dll in $qtDlls) {
|
||||
$sourceDll = Join-Path $vcpkgBinPath $dll
|
||||
Copy-Item -Path $sourceDll -Destination $destinationPath -Force
|
||||
}
|
||||
|
||||
# --- Copy Platform Plugin ---
|
||||
# Create the "platforms" subdirectory if it doesn't exist.
|
||||
$pluginDestPath = Join-Path $destinationPath "platforms"
|
||||
if (-not (Test-Path $pluginDestPath)) {
|
||||
New-Item -ItemType Directory -Path $pluginDestPath
|
||||
}
|
||||
|
||||
Write-Host "Copying platform plugin to $pluginDestPath"
|
||||
$sourcePlugin = Join-Path $vcpkgPluginsPath "qwindowsd.dll"
|
||||
Copy-Item -Path $sourcePlugin -Destination $pluginDestPath -Force
|
||||
|
||||
Write-Host "Deployment complete!" -ForegroundColor Green
|
||||
8
Fundamental_Recursion/.idea/.gitignore
generated
vendored
Normal file
8
Fundamental_Recursion/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
2
Fundamental_Recursion/.idea/Fundamental_Recursion.iml
generated
Normal file
2
Fundamental_Recursion/.idea/Fundamental_Recursion.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
343
Fundamental_Recursion/.idea/editor.xml
generated
Normal file
343
Fundamental_Recursion/.idea/editor.xml
generated
Normal file
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
</component>
|
||||
</project>
|
||||
7
Fundamental_Recursion/.idea/misc.xml
generated
Normal file
7
Fundamental_Recursion/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
8
Fundamental_Recursion/.idea/modules.xml
generated
Normal file
8
Fundamental_Recursion/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Fundamental_Recursion.iml" filepath="$PROJECT_DIR$/.idea/Fundamental_Recursion.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
Fundamental_Recursion/.idea/vcs.xml
generated
Normal file
6
Fundamental_Recursion/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
8
SimpleSearch/.idea/.gitignore
generated
vendored
Normal file
8
SimpleSearch/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
2
SimpleSearch/.idea/SimpleSearch.iml
generated
Normal file
2
SimpleSearch/.idea/SimpleSearch.iml
generated
Normal file
@@ -0,0 +1,2 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CMake" type="CPP_MODULE" version="4" />
|
||||
343
SimpleSearch/.idea/editor.xml
generated
Normal file
343
SimpleSearch/.idea/editor.xml
generated
Normal file
@@ -0,0 +1,343 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppModulePartitionWithSeveralPartitionUnits/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
</component>
|
||||
</project>
|
||||
7
SimpleSearch/.idea/misc.xml
generated
Normal file
7
SimpleSearch/.idea/misc.xml
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakePythonSetting">
|
||||
<option name="pythonIntegrationState" value="YES" />
|
||||
</component>
|
||||
<component name="CMakeWorkspace" PROJECT_DIR="$PROJECT_DIR$" />
|
||||
</project>
|
||||
8
SimpleSearch/.idea/modules.xml
generated
Normal file
8
SimpleSearch/.idea/modules.xml
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/SimpleSearch.iml" filepath="$PROJECT_DIR$/.idea/SimpleSearch.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
6
SimpleSearch/.idea/vcs.xml
generated
Normal file
6
SimpleSearch/.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
8
Stacks&Queues/.idea/.gitignore
generated
vendored
Normal file
8
Stacks&Queues/.idea/.gitignore
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user