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
0b66d67e
Commit
0b66d67e
authored
Sep 28, 2020
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixing git repository
parent
25512340
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
29 deletions
+38
-29
src/CifParser.cpp
+38
-29
No files found.
src/CifParser.cpp
View file @
0b66d67e
...
@@ -888,8 +888,11 @@ void DictParser::linkItems()
...
@@ -888,8 +888,11 @@ void DictParser::linkItems()
{
{
if
(
not
mDataBlock
)
if
(
not
mDataBlock
)
error
(
"no datablock"
);
error
(
"no datablock"
);
auto
&
dict
=
*
mDataBlock
;
std
::
map
<
std
::
tuple
<
std
::
string
,
std
::
string
,
int
>
,
size_t
>
linkIndex
;
std
::
map
<
std
::
tuple
<
std
::
string
,
std
::
string
>
,
size_t
>
linkIndex
;
std
::
map
<
std
::
tuple
<
std
::
string
,
std
::
string
>
,
int
>
linkGroupIds
;
std
::
vector
<
std
::
tuple
<
std
::
vector
<
std
::
string
>
,
std
::
vector
<
std
::
string
>>>
linkKeys
;
std
::
vector
<
std
::
tuple
<
std
::
vector
<
std
::
string
>
,
std
::
vector
<
std
::
string
>>>
linkKeys
;
for
(
auto
gl
:
dict
[
"pdbx_item_linked_group_list"
])
for
(
auto
gl
:
dict
[
"pdbx_item_linked_group_list"
])
...
@@ -906,11 +909,13 @@ void DictParser::linkItems()
...
@@ -906,11 +909,13 @@ void DictParser::linkItems()
if
(
piv
==
nullptr
)
if
(
piv
==
nullptr
)
error
(
"in pdbx_item_linked_group_list, item '"
+
parent
+
"' is not specified"
);
error
(
"in pdbx_item_linked_group_list, item '"
+
parent
+
"' is not specified"
);
auto
key
=
make_tuple
(
piv
->
mCategory
->
mName
,
civ
->
mCategory
->
mName
,
link_group_id
);
auto
key
=
std
::
make_tuple
(
piv
->
mCategory
->
mName
,
civ
->
mCategory
->
mName
);
if
(
not
linkIndex
.
count
(
key
))
if
(
not
linkIndex
.
count
(
key
))
{
{
linkIndex
[
key
]
=
linkKeys
.
size
();
linkIndex
[
key
]
=
linkKeys
.
size
();
linkKeys
.
push_back
({});
linkKeys
.
push_back
({});
linkGroupIds
[
key
]
=
link_group_id
;
}
}
size_t
ix
=
linkIndex
.
at
(
key
);
size_t
ix
=
linkIndex
.
at
(
key
);
...
@@ -919,39 +924,43 @@ void DictParser::linkItems()
...
@@ -919,39 +924,43 @@ void DictParser::linkItems()
std
::
get
<
1
>
(
linkKeys
.
at
(
ix
)).
push_back
(
civ
->
mTag
);
std
::
get
<
1
>
(
linkKeys
.
at
(
ix
)).
push_back
(
civ
->
mTag
);
}
}
// for (auto li: mImpl->mLinkedItems)
// for links recorded in categories but not in pdbx_item_linked_group_list
// {
for
(
auto
li
:
mImpl
->
mLinkedItems
)
// std::string child, parent;
{
// std::tie(child, parent) = li;
std
::
string
child
,
parent
;
//
std
::
tie
(
child
,
parent
)
=
li
;
// auto civ = mValidator.getValidatorForItem(child);
// if (civ == nullptr)
auto
civ
=
mValidator
.
getValidatorForItem
(
child
);
// error("in pdbx_item_linked_group_list, item '" + child + "' is not specified");
if
(
civ
==
nullptr
)
//
error
(
"in pdbx_item_linked_group_list, item '"
+
child
+
"' is not specified"
);
// auto piv = mValidator.getValidatorForItem(parent);
// if (piv == nullptr)
auto
piv
=
mValidator
.
getValidatorForItem
(
parent
);
// error("in pdbx_item_linked_group_list, item '" + parent + "' is not specified");
if
(
piv
==
nullptr
)
//
error
(
"in pdbx_item_linked_group_list, item '"
+
parent
+
"' is not specified"
);
// auto key = make_tuple(piv->mCategory->mName, civ->mCategory->mName, piv->mTag);
// if (not linkIndex.count(key))
auto
key
=
std
::
make_tuple
(
piv
->
mCategory
->
mName
,
civ
->
mCategory
->
mName
);
// {
if
(
not
linkIndex
.
count
(
key
))
// linkIndex[key] = linkKeys.size();
{
// linkKeys.push_back({});
linkIndex
[
key
]
=
linkKeys
.
size
();
// }
linkKeys
.
push_back
({});
//
}
// size_t ix = linkIndex.at(key);
// auto& keys = linkKeys.at(ix);
size_t
ix
=
linkIndex
.
at
(
key
);
//
// keys.insert(civ->mTag);
std
::
get
<
0
>
(
linkKeys
.
at
(
ix
)).
push_back
(
piv
->
mTag
);
// }
std
::
get
<
1
>
(
linkKeys
.
at
(
ix
)).
push_back
(
civ
->
mTag
);
}
auto
&
linkedGroup
=
dict
[
"pdbx_item_linked_group"
];
auto
&
linkedGroup
=
dict
[
"pdbx_item_linked_group"
];
// now store the links in the validator
// now store the links in the validator
for
(
auto
&
kv
:
linkIndex
)
for
(
auto
&
kv
:
linkIndex
)
{
{
ValidateLink
link
;
ValidateLink
link
=
{};
std
::
tie
(
link
.
mParentCategory
,
link
.
mChildCategory
,
link
.
mLinkGroupID
)
=
kv
.
first
;
std
::
tie
(
link
.
mParentCategory
,
link
.
mChildCategory
)
=
kv
.
first
;
if
(
linkGroupIds
.
count
(
kv
.
first
))
link
.
mLinkGroupID
=
linkGroupIds
[
kv
.
first
];
std
::
tie
(
link
.
mParentKeys
,
link
.
mChildKeys
)
=
linkKeys
[
kv
.
second
];
std
::
tie
(
link
.
mParentKeys
,
link
.
mChildKeys
)
=
linkKeys
[
kv
.
second
];
...
...
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