Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs-feliks
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Feliks Kiszkurno
ogs-feliks
Commits
838756a6
Commit
838756a6
authored
6 years ago
by
Tom Fischer
Committed by
Lars Bilke
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[GO2OGS] Impl. of Region.
parent
d8ee8fcd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Applications/FileIO/GocadIO/Region.cpp
+51
-0
51 additions, 0 deletions
Applications/FileIO/GocadIO/Region.cpp
Applications/FileIO/GocadIO/Region.h
+32
-0
32 additions, 0 deletions
Applications/FileIO/GocadIO/Region.h
with
83 additions
and
0 deletions
Applications/FileIO/GocadIO/Region.cpp
0 → 100644
+
51
−
0
View file @
838756a6
/**
*
* @copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/LICENSE.txt
*/
#include
<iterator>
#include
<sstream>
#include
<logog/include/logog.hpp>
#include
"Region.h"
namespace
FileIO
{
namespace
Gocad
{
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
Region
const
&
r
)
{
return
os
<<
"("
<<
r
.
name
<<
"|"
<<
r
.
bit
<<
")"
;
}
Region
parseRegion
(
std
::
string
const
&
line
)
{
std
::
istringstream
iss
(
line
);
std
::
istream_iterator
<
std
::
string
>
it
(
iss
);
// Check first word is REGION or MODEL_REGION.
if
(
*
it
!=
std
::
string
(
"REGION"
)
&&
*
it
!=
std
::
string
(
"MODEL_REGION"
))
{
ERR
(
"Expected REGION or MODEL_REGION keyword but '%s' found.
\n
"
,
it
->
c_str
());
throw
std
::
runtime_error
(
"In parseRegion() expected REGION or MODEL_REGION keyword not "
"found.
\n
"
);
}
++
it
;
Region
r
;
r
.
name
=
*
it
;
++
it
;
r
.
bit
=
atoi
(
it
->
c_str
());
return
r
;
}
}
// end namespace Gocad
}
// end namespace FileIO
This diff is collapsed.
Click to expand it.
Applications/FileIO/GocadIO/Region.h
0 → 100644
+
32
−
0
View file @
838756a6
/**
*
* @copyright
* Copyright (c) 2012-2019, OpenGeoSys Community (http://www.opengeosys.org)
* Distributed under a Modified BSD License.
* See accompanying file LICENSE.txt or
* http://www.opengeosys.org/LICENSE.txt
*/
#pragma once
#include
<string>
#include
<vector>
namespace
FileIO
{
namespace
Gocad
{
struct
Region
final
{
std
::
string
name
;
unsigned
bit
{};
bool
operator
==
(
Region
const
&
r
)
const
{
return
bit
==
r
.
bit
;
}
};
std
::
ostream
&
operator
<<
(
std
::
ostream
&
os
,
Region
const
&
r
);
Region
parseRegion
(
std
::
string
const
&
line
);
}
// end namespace Gocad
}
// end namespace FileIO
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