Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Gruppe44-PROG1003-2022
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andreas Blakli
Gruppe44-PROG1003-2022
Commits
89461f92
There was an error fetching the commit references. Please try again later.
Commit
89461f92
authored
Apr 7, 2022
by
Andreas Blakli
Browse files
Options
Downloads
Patches
Plain Diff
Fjernet ubrukt kode og la til doxygen kommentarer for alle funksjonene i globaleFunksjoner.cpp.
parent
4b12d234
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
globaleFunksjoner.cpp
+24
-1
24 additions, 1 deletion
globaleFunksjoner.cpp
with
24 additions
and
1 deletion
globaleFunksjoner.cpp
+
24
−
1
View file @
89461f92
...
@@ -5,6 +5,10 @@ using namespace std;
...
@@ -5,6 +5,10 @@ using namespace std;
extern
Stoppesteder
*
gStoppesteder
;
extern
Stoppesteder
*
gStoppesteder
;
extern
Ruter
*
gRuter
;
extern
Ruter
*
gRuter
;
/**
* Skriver ut meny valg til terminal.
*
*/
void
skrivMeny
()
{
void
skrivMeny
()
{
cout
<<
"
\n\n
S N - Nytt stoppested"
<<
'\n'
cout
<<
"
\n\n
S N - Nytt stoppested"
<<
'\n'
<<
"S A - Skriv alle stoppesteder"
<<
'\n'
<<
"S A - Skriv alle stoppesteder"
<<
'\n'
...
@@ -17,6 +21,15 @@ void skrivMeny() {
...
@@ -17,6 +21,15 @@ void skrivMeny() {
<<
"Q - Avslutt"
<<
'\n'
;
<<
"Q - Avslutt"
<<
'\n'
;
}
}
/**
* Styre hvilke funksjoner som skal brukes basert på
* bruker input fra CLI.
*
* @see skrivMeny().
* @see delOppValg().
* @see Stoppesteder::meny().
* @see Ruter::meny().
*/
void
meny
()
{
void
meny
()
{
HjelpeFunksjoner
hjelp
;
HjelpeFunksjoner
hjelp
;
string
valg
;
string
valg
;
...
@@ -53,10 +66,16 @@ void meny() {
...
@@ -53,10 +66,16 @@ void meny() {
if
(
valgChars
.
front
()
==
'Q'
)
igjen
=
false
;
if
(
valgChars
.
front
()
==
'Q'
)
igjen
=
false
;
}
else
}
else
cout
<<
"
\n
Ugyldig valg!"
<<
'\n'
;
cout
<<
"
\n
Ugyldig valg!"
<<
'\n'
;
// Så lenge brukren trykker q/Q
// Så lenge bruk
e
ren trykker q/Q
}
while
(
igjen
);
}
while
(
igjen
);
}
}
/**
* Deler opp gitt string.
*
* @param str - Strengen som skal deles.
* @return vector<char> - Hver char fra den gitte strengen.
*/
vector
<
char
>
delOppValg
(
const
std
::
string
&
str
)
{
vector
<
char
>
delOppValg
(
const
std
::
string
&
str
)
{
HjelpeFunksjoner
hjelp
;
HjelpeFunksjoner
hjelp
;
vector
<
string
>
tmp
;
vector
<
string
>
tmp
;
...
@@ -75,6 +94,10 @@ vector<char> delOppValg(const std::string& str) {
...
@@ -75,6 +94,10 @@ vector<char> delOppValg(const std::string& str) {
return
valg
;
return
valg
;
}
}
/**
* Sletter Stoppestedene og Rutene fra minne.
*
*/
void
ryddOppMinne
()
{
void
ryddOppMinne
()
{
delete
gStoppesteder
;
delete
gStoppesteder
;
delete
gRuter
;
delete
gRuter
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment