Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tss
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Jakub Janák
tss
Commits
c07849b9
Commit
c07849b9
authored
4 months ago
by
Jakub Janák
Browse files
Options
Downloads
Patches
Plain Diff
converted to lowercase
parent
494a966e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
controller/Controller.cpp
+3
-3
3 additions, 3 deletions
controller/Controller.cpp
files/FileManager.cpp
+3
-3
3 additions, 3 deletions
files/FileManager.cpp
files/FileManager.h
+3
-3
3 additions, 3 deletions
files/FileManager.h
with
9 additions
and
9 deletions
controller/Controller.cpp
+
3
−
3
View file @
c07849b9
...
...
@@ -97,7 +97,7 @@ int Controller::run(int argc, char *argv[]) {
}
void
Controller
::
load_instance
(
const
std
::
string
&
file_name
)
{
std
::
unique_ptr
<
TSInstance
>
tsInstance
=
FileManager
::
read
DotF
ile
(
FileManager
::
INSTANCES_PATH
+
"/"
+
file_name
);
std
::
unique_ptr
<
TSInstance
>
tsInstance
=
FileManager
::
read
_dot_f
ile
(
FileManager
::
INSTANCES_PATH
+
"/"
+
file_name
);
if
(
tsInstance
==
nullptr
)
{
return
;
}
...
...
@@ -107,8 +107,8 @@ void Controller::load_instance(const std::string &file_name) {
void
Controller
::
auto_load_instances
()
{
std
::
cout
<<
"Loading all instances from "
<<
FileManager
::
INSTANCES_PATH
<<
" automatically"
<<
std
::
endl
;
for
(
const
auto
&
entry
:
FileManager
::
get
DotI
nstances
(
FileManager
::
INSTANCES_PATH
))
{
std
::
unique_ptr
<
TSInstance
>
tsInstance
=
FileManager
::
read
DotF
ile
(
entry
.
path
().
string
());
for
(
const
auto
&
entry
:
FileManager
::
get
_dot_i
nstances
(
FileManager
::
INSTANCES_PATH
))
{
std
::
unique_ptr
<
TSInstance
>
tsInstance
=
FileManager
::
read
_dot_f
ile
(
entry
.
path
().
string
());
this
->
unsolvedInstances
.
push_back
(
std
::
move
(
tsInstance
));
}
}
...
...
This diff is collapsed.
Click to expand it.
files/FileManager.cpp
+
3
−
3
View file @
c07849b9
...
...
@@ -17,7 +17,7 @@ const std::string FileManager::INSTANCES_PATH = "../files/instances";
const
std
::
string
FileManager
::
RESULTS_PATH
=
"../files/results"
;
std
::
unique_ptr
<
TSInstance
>
FileManager
::
read
DotF
ile
(
const
std
::
string
&
file_name
)
{
std
::
unique_ptr
<
TSInstance
>
FileManager
::
read
_dot_f
ile
(
const
std
::
string
&
file_name
)
{
// graphviz context
GVC_t
*
gvc
=
gvContext
();
...
...
@@ -88,7 +88,7 @@ std::unique_ptr<TSInstance> FileManager::readDotFile(const std::string &file_nam
return
std
::
make_unique
<
TSInstance
>
(
std
::
move
(
nodes
),
std
::
move
(
edges
));
}
std
::
vector
<
std
::
filesystem
::
directory_entry
>
FileManager
::
get
DotI
nstances
(
const
std
::
string
&
directory_path
)
{
std
::
vector
<
std
::
filesystem
::
directory_entry
>
FileManager
::
get
_dot_i
nstances
(
const
std
::
string
&
directory_path
)
{
std
::
vector
<
std
::
filesystem
::
directory_entry
>
entries
;
for
(
const
auto
&
entry
:
std
::
filesystem
::
directory_iterator
(
directory_path
))
{
if
(
entry
.
is_regular_file
()
&&
entry
.
path
().
extension
()
==
".dot"
)
{
...
...
@@ -99,7 +99,7 @@ std::vector<std::filesystem::directory_entry> FileManager::getDotInstances(const
return
entries
;
}
void
FileManager
::
save
S
olution
(
const
std
::
string
&
file_name
,
const
std
::
string
&
file_content
)
{
void
FileManager
::
save
_s
olution
(
const
std
::
string
&
file_name
,
const
std
::
string
&
file_content
)
{
// creating the results folder if not exists
if
(
!
std
::
filesystem
::
exists
(
RESULTS_PATH
))
{
if
(
std
::
filesystem
::
create_directory
(
RESULTS_PATH
))
{
...
...
This diff is collapsed.
Click to expand it.
files/FileManager.h
+
3
−
3
View file @
c07849b9
...
...
@@ -16,11 +16,11 @@ public:
static
const
std
::
string
RESULTS_PATH
;
static
std
::
unique_ptr
<
TSInstance
>
read
DotF
ile
(
const
std
::
string
&
file_name
);
static
std
::
unique_ptr
<
TSInstance
>
read
_dot_f
ile
(
const
std
::
string
&
file_name
);
static
std
::
vector
<
std
::
filesystem
::
directory_entry
>
get
DotI
nstances
(
const
std
::
string
&
directory_path
);
static
std
::
vector
<
std
::
filesystem
::
directory_entry
>
get
_dot_i
nstances
(
const
std
::
string
&
directory_path
);
static
void
save
S
olution
(
const
std
::
string
&
file_name
,
const
std
::
string
&
file_content
);
static
void
save
_s
olution
(
const
std
::
string
&
file_name
,
const
std
::
string
&
file_content
);
};
...
...
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