Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
b82b355e
Commit
b82b355e
authored
Jun 01, 2013
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added an openmode argument to the basic_utf8_ifstream.
parent
de6109a0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
12 deletions
+28
-12
unicode.h
dlib/unicode/unicode.h
+12
-8
unicode_abstract.h
dlib/unicode/unicode_abstract.h
+16
-4
No files found.
dlib/unicode/unicode.h
View file @
b82b355e
...
...
@@ -544,41 +544,45 @@ namespace dlib
)
:
std
::
basic_istream
<
charT
>
(
&
buf
),
buf
(
fin
)
{}
basic_utf8_ifstream
(
const
char
*
file_name
const
char
*
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
)
:
std
::
basic_istream
<
charT
>
(
&
buf
),
buf
(
fin
)
{
fin
.
open
(
file_name
);
fin
.
open
(
file_name
,
mode
);
// make this have the same error state as fin
this
->
clear
(
fin
.
rdstate
());
}
basic_utf8_ifstream
(
const
std
::
string
&
file_name
const
std
::
string
&
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
)
:
std
::
basic_istream
<
charT
>
(
&
buf
),
buf
(
fin
)
{
fin
.
open
(
file_name
.
c_str
());
fin
.
open
(
file_name
.
c_str
()
,
mode
);
// make this have the same error state as fin
this
->
clear
(
fin
.
rdstate
());
}
void
open
(
const
std
::
string
&
file_name
const
std
::
string
&
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
)
{
open
(
file_name
.
c_str
());
open
(
file_name
.
c_str
()
,
mode
);
}
void
open
(
const
char
*
file_name
const
char
*
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
)
{
fin
.
close
();
fin
.
clear
();
fin
.
open
(
file_name
);
fin
.
open
(
file_name
,
mode
);
// make this have the same error state as fin
this
->
clear
(
fin
.
rdstate
());
}
...
...
dlib/unicode/unicode_abstract.h
View file @
b82b355e
...
...
@@ -170,35 +170,47 @@ namespace dlib
!*/
basic_utf8_ifstream
(
const
char
*
file_name
const
char
*
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
);
/*!
ensures
- tries to open the given file for reading by this stream
- mode is interpreted exactly the same was as the open mode
argument used by std::ifstream.
!*/
basic_utf8_ifstream
(
const
std
::
string
&
file_name
const
std
::
string
&
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
);
/*!
ensures
- tries to open the given file for reading by this stream
- mode is interpreted exactly the same was as the open mode
argument used by std::ifstream.
!*/
void
open
(
const
std
::
string
&
file_name
const
std
::
string
&
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
);
/*!
ensures
- tries to open the given file for reading by this stream
- mode is interpreted exactly the same was as the open mode
argument used by std::ifstream.
!*/
void
open
(
const
char
*
file_name
const
char
*
file_name
,
std
::
ios_base
::
openmode
mode
=
std
::
ios
::
in
);
/*!
ensures
- tries to open the given file for reading by this stream
- mode is interpreted exactly the same was as the open mode
argument used by std::ifstream.
!*/
void
close
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment