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
c5676f1d
Unverified
Commit
c5676f1d
authored
Jan 12, 2021
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accept compressed raw data in mmcif::File constructor
parent
86854581
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
configure.ac
+3
-3
src/Structure.cpp
+20
-2
No files found.
configure.ac
View file @
c5676f1d
...
@@ -61,8 +61,8 @@ AC_SUBST(LIBTOOL_DEPS)
...
@@ -61,8 +61,8 @@ AC_SUBST(LIBTOOL_DEPS)
dnl versioning, first for libtool
dnl versioning, first for libtool
LIBCIF_CURRENT=1
LIBCIF_CURRENT=1
LIBCIF_REVISION=
0
LIBCIF_REVISION=
1
LIBCIF_AGE=
0
LIBCIF_AGE=
1
LIBCIF_LT_CURRENT="${LIBCIF_CURRENT}"
LIBCIF_LT_CURRENT="${LIBCIF_CURRENT}"
LIBCIF_LT_VERSION="${LIBCIF_CURRENT}:${LIBCIF_REVISION}:${LIBCIF_AGE}"
LIBCIF_LT_VERSION="${LIBCIF_CURRENT}:${LIBCIF_REVISION}:${LIBCIF_AGE}"
...
@@ -71,7 +71,7 @@ AC_SUBST(LIBCIF_LT_CURRENT)
...
@@ -71,7 +71,7 @@ AC_SUBST(LIBCIF_LT_CURRENT)
AC_SUBST(LIBCIF_LT_VERSION)
AC_SUBST(LIBCIF_LT_VERSION)
dnl and now for the semantic version
dnl and now for the semantic version
LIBCIF_SEMANTIC_VERSION=1.
0
.0
LIBCIF_SEMANTIC_VERSION=1.
1
.0
AC_SUBST(LIBCIF_SEMANTIC_VERSION)
AC_SUBST(LIBCIF_SEMANTIC_VERSION)
AC_ARG_VAR([DEBUG], [Build a debug version of the library])
AC_ARG_VAR([DEBUG], [Build a debug version of the library])
...
...
src/Structure.cpp
View file @
c5676f1d
...
@@ -68,6 +68,9 @@ struct FileImpl
...
@@ -68,6 +68,9 @@ struct FileImpl
void
FileImpl
::
load_data
(
const
char
*
data
,
size_t
length
)
void
FileImpl
::
load_data
(
const
char
*
data
,
size_t
length
)
{
{
bool
gzipped
=
length
>
2
and
data
[
0
]
==
(
char
)
0x1f
and
data
[
1
]
==
(
char
)
0x8b
;
bool
bzip2ed
=
length
>
3
and
data
[
0
]
==
(
char
)
0x42
and
data
[
1
]
==
(
char
)
0x5A
and
data
[
2
]
==
(
char
)
0x68
;
try
try
{
{
// First try mmCIF
// First try mmCIF
...
@@ -77,7 +80,15 @@ void FileImpl::load_data(const char* data, size_t length)
...
@@ -77,7 +80,15 @@ void FileImpl::load_data(const char* data, size_t length)
}
buffer
(
const_cast
<
char
*>
(
data
),
length
);
}
buffer
(
const_cast
<
char
*>
(
data
),
length
);
std
::
istream
is
(
&
buffer
);
std
::
istream
is
(
&
buffer
);
mData
.
load
(
is
);
io
::
filtering_stream
<
io
::
input
>
in
;
if
(
gzipped
)
in
.
push
(
io
::
gzip_decompressor
());
else
if
(
bzip2ed
)
in
.
push
(
io
::
bzip2_decompressor
());
in
.
push
(
is
);
mData
.
load
(
in
);
}
}
catch
(
const
cif
::
CifParserError
&
e
)
catch
(
const
cif
::
CifParserError
&
e
)
{
{
...
@@ -89,7 +100,14 @@ void FileImpl::load_data(const char* data, size_t length)
...
@@ -89,7 +100,14 @@ void FileImpl::load_data(const char* data, size_t length)
std
::
istream
is
(
&
buffer
);
std
::
istream
is
(
&
buffer
);
ReadPDBFile
(
is
,
mData
);
io
::
filtering_stream
<
io
::
input
>
in
;
if
(
gzipped
)
in
.
push
(
io
::
gzip_decompressor
());
else
if
(
bzip2ed
)
in
.
push
(
io
::
bzip2_decompressor
());
in
.
push
(
is
);
ReadPDBFile
(
in
,
mData
);
}
}
// Yes, we've parsed the data. Now locate the datablock.
// Yes, we've parsed the data. Now locate the datablock.
...
...
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