Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
b317c780
Unverified
Commit
b317c780
authored
Aug 17, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes for pre c++20
file constructor from raw data
parent
681aa3bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
0 deletions
+29
-0
CMakeLists.txt
+6
-0
include/cif++/file.hpp
+14
-0
include/cif++/item.hpp
+9
-0
No files found.
CMakeLists.txt
View file @
b317c780
...
...
@@ -313,6 +313,12 @@ install(
COMPONENT Devel
)
install
(
FILES include/cif++.hpp
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
COMPONENT Devel
)
install
(
FILES
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_ddl.dic
${
PROJECT_SOURCE_DIR
}
/rsrc/mmcif_pdbx.dic
...
...
include/cif++/file.hpp
View file @
b317c780
...
...
@@ -51,6 +51,20 @@ class file : public std::list<datablock>
load
(
is
);
}
explicit
file
(
const
char
*
data
,
size_t
length
)
{
struct
membuf
:
public
std
::
streambuf
{
membuf
(
char
*
text
,
size_t
length
)
{
this
->
setg
(
text
,
text
,
text
+
length
);
}
}
buffer
(
const_cast
<
char
*>
(
data
),
length
);
std
::
istream
is
(
&
buffer
);
load
(
is
);
}
file
(
const
file
&
)
=
default
;
file
(
file
&&
)
=
default
;
file
&
operator
=
(
const
file
&
)
=
default
;
...
...
include/cif++/item.hpp
View file @
b317c780
...
...
@@ -234,6 +234,15 @@ struct item_handle
return
item_value_as
<
T
>::
compare
(
*
this
,
value
,
true
)
==
0
;
}
// We may not have C++20 yet...
template
<
typename
T
>
bool
operator
!=
(
const
T
&
value
)
const
{
// TODO: icase or not icase?
return
item_value_as
<
T
>::
compare
(
*
this
,
value
,
true
)
!=
0
;
}
// empty means either null or unknown
bool
empty
()
const
{
...
...
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