Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-xt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ag-ohlberger
dune-community
dune-xt
Commits
06d53870
Commit
06d53870
authored
11 years ago
by
Dr. Felix Tobias Schindler
Browse files
Options
Downloads
Patches
Plain Diff
[commo.color] moved colorString() and colorStringRed() to lib
parent
3e1d4bde
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/stuff/common/color.cc
+11
-0
11 additions, 0 deletions
dune/stuff/common/color.cc
dune/stuff/common/color.hh
+2
-8
2 additions, 8 deletions
dune/stuff/common/color.hh
with
13 additions
and
8 deletions
dune/stuff/common/color.cc
+
11
−
0
View file @
06d53870
...
@@ -98,6 +98,17 @@ std::string highlightSearchString(std::string str, std::string substr, int color
...
@@ -98,6 +98,17 @@ std::string highlightSearchString(std::string str, std::string substr, int color
return
str
;
return
str
;
}
// highlightSearchString
}
// highlightSearchString
std
::
string
colorString
(
const
std
::
string
_string
,
const
std
::
string
_color
/*= Colors::brown*/
)
{
return
_color
+
_string
+
"
\033
[0m"
;
}
std
::
string
colorStringRed
(
const
std
::
string
_string
)
{
return
colorString
(
_string
,
Colors
::
red
);
}
}
// namespace Common
}
// namespace Common
}
// namespace Stuff
}
// namespace Stuff
}
// namespace Dune
}
// namespace Dune
This diff is collapsed.
Click to expand it.
dune/stuff/common/color.hh
+
2
−
8
View file @
06d53870
...
@@ -132,15 +132,9 @@ inline std::string highlightString(std::string str, int colornr = 0)
...
@@ -132,15 +132,9 @@ inline std::string highlightString(std::string str, int colornr = 0)
return
"
\033
[38;5;"
+
toString
(
colornr
%
256
)
+
"m"
+
str
+
"
\033
[0m"
;
//"\033[38;5;0m";
return
"
\033
[38;5;"
+
toString
(
colornr
%
256
)
+
"m"
+
str
+
"
\033
[0m"
;
//"\033[38;5;0m";
}
}
inline
std
::
string
colorString
(
const
std
::
string
_string
,
const
std
::
string
_color
=
Colors
::
brown
)
std
::
string
colorString
(
const
std
::
string
_string
,
const
std
::
string
_color
=
Colors
::
brown
);
{
return
_color
+
_string
+
"
\033
[0m"
;
}
inline
std
::
string
colorStringRed
(
const
std
::
string
_string
)
std
::
string
colorStringRed
(
const
std
::
string
_string
);
{
return
colorString
(
_string
,
Colors
::
red
);
}
/**
/**
* @brief Highlights a substring of another string in a specified color.
* @brief Highlights a substring of another string in a specified color.
...
...
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