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 @@
...
@@ -24,11 +24,13 @@
# XXX doc
# XXX doc
from
libcpp
cimport
nullptr_t
,
nullptr
as
nil
from
libcpp
cimport
nullptr_t
,
nullptr
as
nil
from
libcpp.string
cimport
string
cdef
extern
from
*
:
cdef
extern
from
*
:
ctypedef
bint
cbool
"bool"
ctypedef
bint
cbool
"bool"
cdef
extern
from
"wcfs_misc.h"
nogil
:
cdef
extern
from
"wcfs_misc.h"
nogil
:
cppclass
error
:
cppclass
error
:
string
Error
()
const
cbool
operator
==
(
nullptr_t
)
const
cbool
operator
==
(
nullptr_t
)
const
cbool
operator
!=
(
nullptr_t
)
const
cbool
operator
!=
(
nullptr_t
)
const
cbool
operator
==
(
const
error
&
)
const
cbool
operator
==
(
const
error
&
)
const
...
@@ -48,7 +50,7 @@ cdef class PyWatchLink:
...
@@ -48,7 +50,7 @@ cdef class PyWatchLink:
with
nogil
:
with
nogil
:
err
=
wlink_close_pyexc
(
pywlink
.
wlink
)
err
=
wlink_close_pyexc
(
pywlink
.
wlink
)
if
err
!=
nil
:
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;
...
@@ -50,15 +50,18 @@ using std::vector;
const
nullptr_t
nil
=
nullptr
;
const
nullptr_t
nil
=
nullptr
;
// error mimics error from Go.
// error mimics error from Go.
struct
error
{
class
error
{
string
err
;
// XXX -> private + ,error() ?
string
_err
;
public:
string
Error
()
const
;
error
()
{}
error
()
{}
error
(
nullptr_t
)
{}
// = nil
error
(
nullptr_t
)
{}
// = nil
// == nil
// == nil
bool
operator
==
(
nullptr_t
)
const
{
bool
operator
==
(
nullptr_t
)
const
{
return
err
.
empty
();
return
_
err
.
empty
();
}
}
bool
operator
!=
(
nullptr_t
)
const
{
bool
operator
!=
(
nullptr_t
)
const
{
return
!
(
*
this
==
NULL
);
return
!
(
*
this
==
NULL
);
...
@@ -66,7 +69,7 @@ struct error {
...
@@ -66,7 +69,7 @@ struct error {
// == error
// == error
bool
operator
==
(
const
error
&
rhs
)
const
{
bool
operator
==
(
const
error
&
rhs
)
const
{
return
(
err
==
rhs
.
err
);
return
(
_err
==
rhs
.
_
err
);
}
}
bool
operator
!=
(
const
error
&
rhs
)
const
{
bool
operator
!=
(
const
error
&
rhs
)
const
{
return
!
(
*
this
==
rhs
);
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