Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Dmitri Naumov
ogs
Commits
f4b30367
Commit
f4b30367
authored
12 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Using logog logging within class XMLInterface.
parent
4338d7a9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FileIO/XmlIO/XMLInterface.cpp
+12
-15
12 additions, 15 deletions
FileIO/XmlIO/XMLInterface.cpp
with
12 additions
and
15 deletions
FileIO/XmlIO/XMLInterface.cpp
+
12
−
15
View file @
f4b30367
...
...
@@ -12,6 +12,9 @@
#include
<fstream>
// ThirdParty/logog
#include
"logog/include/logog.hpp"
#include
"ProjectData.h"
#include
"XMLInterface.h"
...
...
@@ -22,12 +25,10 @@
#include
<QtXmlPatterns/QXmlSchema>
#include
<QtXmlPatterns/QXmlSchemaValidator>
namespace
FileIO
{
XMLInterface
::
XMLInterface
(
ProjectData
*
project
,
const
std
::
string
&
schemaFile
)
:
_project
(
project
),
_exportName
(
""
),
_schemaName
(
schemaFile
)
XMLInterface
::
XMLInterface
(
ProjectData
*
project
,
const
std
::
string
&
schemaFile
)
:
_project
(
project
),
_exportName
(
""
),
_schemaName
(
schemaFile
)
{
}
...
...
@@ -43,16 +44,14 @@ int XMLInterface::isValid(const QString &fileName) const
return
1
;
else
{
std
::
cout
<<
"XMLInterface::isValid() - XML File is invalid (in reference to schema "
<<
_schemaName
<<
")."
<<
std
::
endl
;
INFO
(
"XMLInterface::isValid(): XML file %s is invalid (in reference to schema %s)."
,
fileName
.
data
(),
_schemaName
.
c_str
());
return
0
;
}
}
else
{
std
::
cout
<<
"XMLInterface::isValid() - Schema "
<<
_schemaName
<<
" is invalid."
<<
std
::
endl
;
INFO
(
"XMLInterface::isValid(): Schema %s is invalid."
,
_schemaName
.
c_str
());
return
0
;
}
}
...
...
@@ -62,7 +61,6 @@ void XMLInterface::setSchema(const std::string &schemaName)
_schemaName
=
schemaName
;
}
int
XMLInterface
::
insertStyleFileDefinition
(
const
QString
&
fileName
)
const
{
std
::
string
path
=
fileName
.
toStdString
();
...
...
@@ -72,7 +70,8 @@ int XMLInterface::insertStyleFileDefinition(const QString &fileName) const
if
(
!
stream
.
is_open
())
{
std
::
cout
<<
"XMLInterface::insertStyleFileDefinition() - Could not open file...
\n
"
;
WARN
(
"XMLInterface::insertStyleFileDefinition(): Could not open file %s."
,
path
.
c_str
());
return
0
;
}
...
...
@@ -101,7 +100,7 @@ bool XMLInterface::checkHash(const QString &fileName) const
if
(
!
this
->
isValid
(
fileName
))
return
false
;
std
::
cout
<<
"File is valid, writing hashfile.
.."
<<
std
::
endl
;
INFO
(
"File is valid, writing hashfile.
"
)
;
QByteArray
hash
=
calcHash
(
fileName
);
std
::
ofstream
out
(
md5FileName
.
toStdString
().
c_str
(),
std
::
ios
::
out
);
out
.
write
(
hash
.
data
(),
16
);
...
...
@@ -118,8 +117,7 @@ bool XMLInterface::hashIsGood(const QString &fileName, const QByteArray &hash) c
for
(
int
i
=
0
;
i
<
hashLength
;
i
++
)
if
(
fileHash
[
i
]
!=
hash
[
i
])
{
std
::
cout
<<
"Hashfile does not match data ... checking file ..."
<<
std
::
endl
;
INFO
(
"Hashfile does not match data ... checking file ..."
);
return
false
;
}
return
true
;
...
...
@@ -139,5 +137,4 @@ QByteArray XMLInterface::calcHash(const QString &fileName) const
delete
[]
buffer
;
return
hash
;
}
}
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