Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
5e6cbc63
Commit
5e6cbc63
authored
Oct 29, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
3ba362ba
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
0 deletions
+36
-0
wcfs/internal/wcfs_misc.cpp
wcfs/internal/wcfs_misc.cpp
+19
-0
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+10
-0
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+7
-0
No files found.
wcfs/internal/wcfs_misc.cpp
View file @
5e6cbc63
...
...
@@ -194,3 +194,22 @@ error errorf(const char *format, ...) {
}
}
// fmt::
// strings::
namespace
strings
{
vector
<
string
>
split
(
const
string
&
s
,
char
sep
)
{
vector
<
string
>
r
;
int
psep_prev
=-
1
,
psep
;
while
(
1
)
{
psep
=
s
.
find
(
sep
,
psep_prev
+
1
);
if
(
psep
==
string
::
npos
)
return
r
;
r
.
push_back
(
s
.
substr
(
psep_prev
+
1
,
sep
-
(
psep_prev
+
1
)));
psep_prev
=
sep
;
}
}
}
// strings::
wcfs/internal/wcfs_misc.h
View file @
5e6cbc63
...
...
@@ -30,6 +30,9 @@ using std::tuple;
using
std
::
make_tuple
;
using
std
::
tie
;
#include <vector>
using
std
::
vector
;
// nil is synonym for nullptr and NULL.
const
nullptr_t
nil
=
nullptr
;
...
...
@@ -137,6 +140,13 @@ error errorf (const char *format, ...)
}
// fmt::
// strings::
namespace
strings
{
vector
<
string
>
split
(
const
string
&
s
,
char
sep
);
}
// strings::
// ---- misc ----
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
5e6cbc63
...
...
@@ -684,6 +684,13 @@ error WatchLink::recvReq(IContext *ctx, SrvReq *rx) {
return
SrvReq
(
wlink
,
stream
,
msg
)
}
// _parsePinReq parses message into PinReq according to wcfs invalidation protocol.
error
_parsePinReq
(
PinReq
*
out
,
const
string
&
msg
)
{
// pin <foid>) #<blk> @<at>
msgv
=
strings
::
split
(
msg
,
' '
);
if
}
// _readline reads next raw line sent from wcfs.
tuple
<
string
,
error
>
WatchLink
::
_readline
()
{
WatchLink
&
wlink
=
*
this
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment