Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
2a7faff2
Commit
2a7faff2
authored
6 years ago
by
Bienchen
Browse files
Options
Downloads
Patches
Plain Diff
Added methods to deal witht he citation type.
parent
f9c31892
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/io/src/mol/mmcif_info.hh
+55
-7
55 additions, 7 deletions
modules/io/src/mol/mmcif_info.hh
modules/io/tests/test_mmcif_info.cc
+13
-0
13 additions, 0 deletions
modules/io/tests/test_mmcif_info.cc
with
68 additions
and
7 deletions
modules/io/src/mol/mmcif_info.hh
+
55
−
7
View file @
2a7faff2
...
...
@@ -390,6 +390,13 @@ private:
class
DLLEXPORT_OST_IO
MMCifInfoCitation
{
public:
/// \enum types of citations
typedef
enum
{
JOURNAL
,
BOOK
,
UNKNOWN
}
MMCifInfoCType
;
/// \brief Create a citation.
MMCifInfoCitation
()
:
id_
(
""
),
where_
(
UNKNOWN
),
cas_
(
""
),
published_in_
(
""
),
volume_
(
""
),
page_first_
(
""
),
page_last_
(
""
),
doi_
(
""
),
pubmed_
(
0
),
...
...
@@ -506,6 +513,54 @@ public:
/// \return title
String
GetTitle
()
const
{
return
title_
;
}
/// \brief Set the type of a publication
///
/// \param publication_type
void
SetCitationType
(
MMCifInfoCType
publication_type
)
{
where_
=
publication_type
;
}
/// \brief Set the type of a publication to journal
void
SetCitationTypeJournal
()
{
where_
=
MMCifInfoCitation
::
JOURNAL
;
}
/// \brief Set the type of a publication to book
void
SetCitationTypeBook
()
{
where_
=
MMCifInfoCitation
::
BOOK
;
}
/// \brief Set the type of a publication to unknown
void
SetCitationTypeUnknown
()
{
where_
=
MMCifInfoCitation
::
UNKNOWN
;
}
/// \brief Get the type of a publication
///
/// \return citation type
MMCifInfoCType
GetCitationType
()
const
{
return
where_
;
}
/// \brief Check a citation to be published in a journal
///
/// \return true or false
bool
IsCitationTypeJournal
()
const
{
return
where_
==
MMCifInfoCitation
::
JOURNAL
;
}
/// \brief Check a citation to be published in a book
///
/// \return true or false
bool
IsCitationTypeBook
()
const
{
return
where_
==
MMCifInfoCitation
::
BOOK
;
}
/// \brief Check if the citation type is unknow
///
/// \return true or false
bool
IsCitationTypeUnknown
()
const
{
return
where_
==
MMCifInfoCitation
::
UNKNOWN
;
}
/// \brief Set the list of authors
///
/// \param list
...
...
@@ -574,13 +629,6 @@ public:
}
private
:
/// \enum types of citations
typedef
enum
{
JOURNAL
,
BOOK
,
UNKNOWN
}
MMCifInfoCType
;
String
id_
;
///< internal identifier
MMCifInfoCType
where_
;
///< journal or book?
String
cas_
;
///< CAS identifier
...
...
This diff is collapsed.
Click to expand it.
modules/io/tests/test_mmcif_info.cc
+
13
−
0
View file @
2a7faff2
...
...
@@ -73,6 +73,7 @@ BOOST_AUTO_TEST_CASE(mmcif_info_citation)
cit
.
SetYear
(
815
);
cit
.
SetTitle
(
"Foo"
);
cit
.
SetAuthorList
(
author_list
);
cit
.
SetCitationType
(
MMCifInfoCitation
::
JOURNAL
);
author_list
.
clear
();
BOOST_CHECK
(
cit
.
GetID
()
==
"ID"
);
...
...
@@ -86,9 +87,21 @@ BOOST_AUTO_TEST_CASE(mmcif_info_citation)
BOOST_CHECK
(
cit
.
GetPubMed
()
==
815
);
BOOST_CHECK
(
cit
.
GetYear
()
==
815
);
BOOST_CHECK
(
cit
.
GetTitle
()
==
"Foo"
);
BOOST_CHECK
(
cit
.
GetCitationType
()
==
MMCifInfoCitation
::
JOURNAL
);
BOOST_CHECK
(
cit
.
IsCitationTypeJournal
()
==
true
);
BOOST_CHECK
(
cit
.
IsCitationTypeBook
()
==
false
);
BOOST_CHECK
(
cit
.
IsCitationTypeUnknown
()
==
false
);
author_list
=
cit
.
GetAuthorList
();
BOOST_CHECK
(
author_list
.
back
()
==
"Kabel, H."
);
// checking all possible variants of citation type
cit
.
SetCitationTypeJournal
();
BOOST_CHECK
(
cit
.
IsCitationTypeJournal
()
==
true
);
cit
.
SetCitationTypeBook
();
BOOST_CHECK
(
cit
.
IsCitationTypeBook
()
==
true
);
cit
.
SetCitationTypeUnknown
();
BOOST_CHECK
(
cit
.
IsCitationTypeUnknown
()
==
true
);
BOOST_TEST_MESSAGE
(
" done."
);
BOOST_TEST_MESSAGE
(
" trying to add everything to an info object"
);
MMCifInfo
info
=
MMCifInfo
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment