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
3ebe99a6
Commit
3ebe99a6
authored
Nov 01, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
f89760d1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
5 deletions
+10
-5
wcfs/internal/_wcfs.pyx
wcfs/internal/_wcfs.pyx
+3
-1
wcfs/internal/wcfs_misc.h
wcfs/internal/wcfs_misc.h
+7
-4
No files found.
wcfs/internal/_wcfs.pyx
View file @
3ebe99a6
...
...
@@ -24,11 +24,13 @@
# XXX doc
from
libcpp
cimport
nullptr_t
,
nullptr
as
nil
from
libcpp.string
cimport
string
cdef
extern
from
*
:
ctypedef
bint
cbool
"bool"
cdef
extern
from
"wcfs_misc.h"
nogil
:
cppclass
error
:
string
Error
()
const
cbool
operator
==
(
nullptr_t
)
const
cbool
operator
!=
(
nullptr_t
)
const
cbool
operator
==
(
const
error
&
)
const
...
...
@@ -48,7 +50,7 @@ cdef class PyWatchLink:
with
nogil
:
err
=
wlink_close_pyexc
(
pywlink
.
wlink
)
if
err
!=
nil
:
raise
RuntimeError
(
err
)
# XXX exc class?
raise
RuntimeError
(
err
.
Error
()
)
# XXX exc class?
...
...
wcfs/internal/wcfs_misc.h
View file @
3ebe99a6
...
...
@@ -50,15 +50,18 @@ using std::vector;
const
nullptr_t
nil
=
nullptr
;
// error mimics error from Go.
struct
error
{
string
err
;
// XXX -> private + ,error() ?
class
error
{
string
_err
;
public:
string
Error
()
const
;
error
()
{}
error
(
nullptr_t
)
{}
// = nil
// == nil
bool
operator
==
(
nullptr_t
)
const
{
return
err
.
empty
();
return
_
err
.
empty
();
}
bool
operator
!=
(
nullptr_t
)
const
{
return
!
(
*
this
==
NULL
);
...
...
@@ -66,7 +69,7 @@ struct error {
// == error
bool
operator
==
(
const
error
&
rhs
)
const
{
return
(
err
==
rhs
.
err
);
return
(
_err
==
rhs
.
_
err
);
}
bool
operator
!=
(
const
error
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
...
...
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