Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
489d838b
Commit
489d838b
authored
14 years ago
by
Adam Wardynski
Browse files
Options
Downloads
Patches
Plain Diff
Pulling out std_read_loop for libedit's fallback
parent
1fde16fb
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
wcclparser/main.cpp
+14
-8
14 additions, 8 deletions
wcclparser/main.cpp
with
14 additions
and
8 deletions
wcclparser/main.cpp
+
14
−
8
View file @
489d838b
...
...
@@ -32,6 +32,18 @@ namespace {
const
char
*
_prompt
=
"Enter any operator expression: "
;
}
void
std_read_loop
(
boost
::
function
<
bool
(
const
std
::
string
&
)
>&
line_cb
)
{
while
(
std
::
cin
.
good
())
{
std
::
cout
<<
_prompt
<<
std
::
flush
;
std
::
string
s
;
getline
(
std
::
cin
,
s
);
if
(
line_cb
(
s
))
{
return
;
}
}
}
#if defined(HAVE_LIBEDIT) && !defined(_WINDOWS) //non-Windows libedit read loop
const
char
*
query_prompt
(
EditLine
*
)
{
...
...
@@ -122,16 +134,10 @@ void read_loop(boost::function<bool (const std::string&)>& line_cb)
#else // standard io read loop
inline
void
read_loop
(
boost
::
function
<
bool
(
const
std
::
string
&
)
>&
line_cb
)
{
while
(
std
::
cin
.
good
())
{
std
::
cout
<<
_prompt
<<
std
::
flush
;
std
::
string
s
;
getline
(
std
::
cin
,
s
);
if
(
line_cb
(
s
))
{
return
;
}
}
std_read_loop
(
line_cb
);
}
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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