Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
0f505907
There was an error fetching the commit references. Please try again later.
Commit
0f505907
authored
6 years ago
by
Jakub Klinkovský
Browse files
Options
Downloads
Patches
Plain Diff
Moved stuff from Object.cpp to Object_impl.h
parent
c573f43c
No related branches found
No related tags found
1 merge request
!22
Header only
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/TNL/CMakeLists.txt
+1
-1
1 addition, 1 deletion
src/TNL/CMakeLists.txt
src/TNL/Object.h
+2
-0
2 additions, 0 deletions
src/TNL/Object.h
src/TNL/Object_impl.h
+19
-17
19 additions, 17 deletions
src/TNL/Object_impl.h
with
22 additions
and
18 deletions
src/TNL/CMakeLists.txt
+
1
−
1
View file @
0f505907
...
...
@@ -26,6 +26,7 @@ set( headers
FileName.h
FileName.hpp
Object.h
Object_impl.h
Logger.h
Logger_impl.h
Math.h
...
...
@@ -38,7 +39,6 @@ set( headers
set
(
common_SOURCES
FileName.cpp
Object.cpp
String.cpp
Timer.cpp
)
...
...
This diff is collapsed.
Click to expand it.
src/TNL/Object.h
+
2
−
0
View file @
0f505907
...
...
@@ -113,3 +113,5 @@ std::vector< String >
parseObjectType
(
const
String
&
objectType
);
}
// namespace TNL
#include
<TNL/Object_impl.h>
This diff is collapsed.
Click to expand it.
src/TNL/Object
.cpp
→
src/TNL/Object
_impl.h
+
19
−
17
View file @
0f505907
/***************************************************************************
Object
.cpp
- description
Object
_impl.h
- description
-------------------
begin : 2005/10/15
copyright : (C) 2005 by Tomas Oberhuber
...
...
@@ -8,37 +8,39 @@
/* See Copyright Notice in tnl/Copyright */
#
include
<TNL/Object.h>
#include
<TNL/Assert.h>
#
pragma once
#include
<iostream>
#include
<fstream>
#include
<cstring>
#include
<TNL/Object.h>
namespace
TNL
{
const
char
magic_number
[]
=
"TNLMN"
;
static
const
expr
char
magic_number
[]
=
"TNLMN"
;
String
Object
::
getType
()
inline
String
Object
::
getType
()
{
return
String
(
"Object"
);
}
String
Object
::
getTypeVirtual
()
const
inline
String
Object
::
getTypeVirtual
()
const
{
return
this
->
getType
();
}
String
Object
::
getSerializationType
()
inline
String
Object
::
getSerializationType
()
{
return
String
(
"Object"
);
}
String
Object
::
getSerializationTypeVirtual
()
const
inline
String
Object
::
getSerializationTypeVirtual
()
const
{
return
this
->
getSerializationType
();
}
bool
Object
::
save
(
File
&
file
)
const
inline
bool
Object
::
save
(
File
&
file
)
const
{
if
(
!
file
.
write
(
magic_number
,
strlen
(
magic_number
)
)
)
return
false
;
...
...
@@ -46,7 +48,7 @@ bool Object :: save( File& file ) const
return
true
;
}
bool
Object
::
load
(
File
&
file
)
inline
bool
Object
::
load
(
File
&
file
)
{
String
objectType
;
if
(
!
getObjectType
(
file
,
objectType
)
)
...
...
@@ -59,12 +61,12 @@ bool Object :: load( File& file )
return
true
;
}
bool
Object
::
boundLoad
(
File
&
file
)
inline
bool
Object
::
boundLoad
(
File
&
file
)
{
return
load
(
file
);
}
bool
Object
::
save
(
const
String
&
fileName
)
const
inline
bool
Object
::
save
(
const
String
&
fileName
)
const
{
File
file
;
if
(
!
file
.
open
(
fileName
,
IOMode
::
write
)
)
...
...
@@ -75,7 +77,7 @@ bool Object :: save( const String& fileName ) const
return
this
->
save
(
file
);
}
bool
Object
::
load
(
const
String
&
fileName
)
inline
bool
Object
::
load
(
const
String
&
fileName
)
{
File
file
;
if
(
!
file
.
open
(
fileName
,
IOMode
::
read
)
)
...
...
@@ -86,7 +88,7 @@ bool Object :: load( const String& fileName )
return
this
->
load
(
file
);
}
bool
Object
::
boundLoad
(
const
String
&
fileName
)
inline
bool
Object
::
boundLoad
(
const
String
&
fileName
)
{
File
file
;
if
(
!
file
.
open
(
fileName
,
IOMode
::
read
)
)
...
...
@@ -98,7 +100,7 @@ bool Object :: boundLoad( const String& fileName )
}
bool
getObjectType
(
File
&
file
,
String
&
type
)
inline
bool
getObjectType
(
File
&
file
,
String
&
type
)
{
char
mn
[
10
];
if
(
!
file
.
read
(
mn
,
strlen
(
magic_number
)
)
)
...
...
@@ -119,7 +121,7 @@ bool getObjectType( File& file, String& type )
return
true
;
}
bool
getObjectType
(
const
String
&
fileName
,
String
&
type
)
inline
bool
getObjectType
(
const
String
&
fileName
,
String
&
type
)
{
File
binaryFile
;
if
(
!
binaryFile
.
open
(
fileName
,
IOMode
::
read
)
)
...
...
@@ -130,7 +132,7 @@ bool getObjectType( const String& fileName, String& type )
return
getObjectType
(
binaryFile
,
type
);
}
std
::
vector
<
String
>
inline
std
::
vector
<
String
>
parseObjectType
(
const
String
&
objectType
)
{
std
::
vector
<
String
>
parsedObjectType
;
...
...
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