Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PacketLib
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Andrea Bulgarelli
PacketLib
Commits
931b835b
Commit
931b835b
authored
Feb 26, 2014
by
Andrea Bulgarelli
Browse files
Options
Downloads
Patches
Plain Diff
File seek and ftell as long
parent
a42d5ce3
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
include/File.h
+5
-5
5 additions, 5 deletions
include/File.h
include/InputFile.h
+1
-1
1 addition, 1 deletion
include/InputFile.h
src/File.cpp
+4
-4
4 additions, 4 deletions
src/File.cpp
src/InputFile.cpp
+1
-1
1 addition, 1 deletion
src/InputFile.cpp
version
+1
-0
1 addition, 0 deletions
version
with
12 additions
and
11 deletions
include/File.h
+
5
−
5
View file @
931b835b
...
@@ -78,11 +78,11 @@ public:
...
@@ -78,11 +78,11 @@ public:
/// Sets the position into file.
/// Sets the position into file.
/// \pre The file must be opened.
/// \pre The file must be opened.
virtual
dword
setpos
(
dword
offset
)
throw
(
PacketExceptionIO
*
);
virtual
long
setpos
(
long
offset
)
throw
(
PacketExceptionIO
*
);
/// Gets the current file position.
/// Gets the current file position.
/// \pre The file must be opened.
/// \pre The file must be opened.
virtual
dword
getpos
();
virtual
long
getpos
();
/// Stores the current position
/// Stores the current position
/// \pre The file must be opened.
/// \pre The file must be opened.
...
@@ -96,7 +96,7 @@ public:
...
@@ -96,7 +96,7 @@ public:
virtual
bool
isEOF
();
virtual
bool
isEOF
();
/// \pre The file must be opened.
/// \pre The file must be opened.
int
setFirstPos
()
throw
(
PacketExceptionIO
*
);
long
setFirstPos
()
throw
(
PacketExceptionIO
*
);
/// Changes directory. The path is in the filename of file opened.
/// Changes directory. The path is in the filename of file opened.
/// \pre The file name must be set.
/// \pre The file name must be set.
...
@@ -128,9 +128,9 @@ protected:
...
@@ -128,9 +128,9 @@ protected:
FILE
*
fp
;
FILE
*
fp
;
dword
bookmarkPos
;
long
bookmarkPos
;
dword
startPosition
;
long
startPosition
;
char
*
filename
;
char
*
filename
;
...
...
This diff is collapsed.
Click to expand it.
include/InputFile.h
+
1
−
1
View file @
931b835b
...
@@ -46,7 +46,7 @@ public:
...
@@ -46,7 +46,7 @@ public:
return
0
;
return
0
;
};
};
virtual
dword
setpos
(
dword
offset
)
throw
(
PacketExceptionIO
*
);
virtual
dword
setpos
(
long
offset
)
throw
(
PacketExceptionIO
*
);
protected
:
protected
:
...
...
This diff is collapsed.
Click to expand it.
src/File.cpp
+
4
−
4
View file @
931b835b
...
@@ -233,9 +233,9 @@ char* File::getLastLineRead()
...
@@ -233,9 +233,9 @@ char* File::getLastLineRead()
}
}
dword
File
::
setpos
(
dword
offset
)
throw
(
PacketExceptionIO
*
)
long
File
::
setpos
(
long
offset
)
throw
(
PacketExceptionIO
*
)
{
{
dword
f
;
long
f
;
//clearerr(fp);
//clearerr(fp);
f
=
fseek
(
fp
,
offset
,
0
);
f
=
fseek
(
fp
,
offset
,
0
);
if
(
feof
(
fp
))
if
(
feof
(
fp
))
...
@@ -247,7 +247,7 @@ dword File::setpos(dword offset) throw(PacketExceptionIO*)
...
@@ -247,7 +247,7 @@ dword File::setpos(dword offset) throw(PacketExceptionIO*)
dword
File
::
getpos
()
long
File
::
getpos
()
{
{
return
ftell
(
fp
);
return
ftell
(
fp
);
}
}
...
@@ -283,7 +283,7 @@ bool File::isEOF()
...
@@ -283,7 +283,7 @@ bool File::isEOF()
int
File
::
setFirstPos
()
throw
(
PacketExceptionIO
*
)
long
File
::
setFirstPos
()
throw
(
PacketExceptionIO
*
)
{
{
return
setpos
(
startPosition
);
return
setpos
(
startPosition
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/InputFile.cpp
+
1
−
1
View file @
931b835b
...
@@ -75,6 +75,6 @@ char* InputFile::readString() throw(PacketExceptionIO*)
...
@@ -75,6 +75,6 @@ char* InputFile::readString() throw(PacketExceptionIO*)
return
c
;
return
c
;
}
}
dword
InputFile
::
setpos
(
dword
offset
)
throw
(
PacketExceptionIO
*
)
{
dword
InputFile
::
setpos
(
long
offset
)
throw
(
PacketExceptionIO
*
)
{
return
file
->
setpos
(
offset
);
return
file
->
setpos
(
offset
);
}
}
This diff is collapsed.
Click to expand it.
version
+
1
−
0
View file @
931b835b
3.0.0
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