Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
doxverilog
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
Elphel
doxverilog
Commits
a7da2bd6
Commit
a7da2bd6
authored
Jul 02, 2013
by
Dimitri van Heesch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 702491 - UTF-16LE BOM not handled by source browser and \snippet
parent
4c50bd75
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
util.cpp
src/util.cpp
+18
-4
util.h
src/util.h
+2
-1
No files found.
src/util.cpp
View file @
a7da2bd6
...
...
@@ -2420,6 +2420,19 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode)
err
(
"file `%s' not found
\n
"
,
name
);
return
""
;
}
BufStr
buf
(
fi
.
size
());
fileOpened
=
readInputFile
(
name
,
buf
,
filter
,
isSourceCode
);
if
(
fileOpened
)
{
int
s
=
buf
.
size
();
if
(
s
>
1
&&
buf
.
at
(
s
-
2
)
!=
'\n'
)
{
buf
.
at
(
s
-
1
)
=
'\n'
;
buf
.
addChar
(
0
);
}
return
buf
.
data
();
}
#if 0
QCString filterName = getFileFilter(name,isSourceCode);
if (filterName.isEmpty() || !filter)
{
...
...
@@ -2472,6 +2485,7 @@ QCString fileToString(const char *name,bool filter,bool isSourceCode)
Debug::print(Debug::FilterOutput,0,"-------------\n%s\n-------------\n",contents.data());
return transcodeCharacterStringToUTF8(contents);
}
#endif
}
if
(
!
fileOpened
)
{
...
...
@@ -7345,7 +7359,7 @@ static int transcodeCharacterBuffer(const char *fileName,BufStr &srcBuf,int size
}
//! read a file name \a fileName and optionally filter and transcode it
bool
readInputFile
(
const
char
*
fileName
,
BufStr
&
inBuf
)
bool
readInputFile
(
const
char
*
fileName
,
BufStr
&
inBuf
,
bool
filter
,
bool
isSourceCode
)
{
// try to open file
int
size
=
0
;
...
...
@@ -7354,8 +7368,8 @@ bool readInputFile(const char *fileName,BufStr &inBuf)
QFileInfo
fi
(
fileName
);
if
(
!
fi
.
exists
())
return
FALSE
;
QCString
filterName
=
getFileFilter
(
fileName
,
FALSE
);
if
(
filterName
.
isEmpty
())
QCString
filterName
=
getFileFilter
(
fileName
,
isSourceCode
);
if
(
filterName
.
isEmpty
()
||
!
filter
)
{
QFile
f
(
fileName
);
if
(
!
f
.
open
(
IO_ReadOnly
))
...
...
@@ -7432,7 +7446,7 @@ bool readInputFile(const char *fileName,BufStr &inBuf)
inBuf
.
shrink
(
newSize
);
// resize the array
//printf(".......resizing from %d to %d result=[%s]\n",oldPos+size,oldPos+newSize,dest.data());
}
inBuf
.
a
t
(
inBuf
.
curPos
())
=
'\0'
;
inBuf
.
a
ddChar
(
0
)
;
return
TRUE
;
}
...
...
src/util.h
View file @
a7da2bd6
...
...
@@ -372,7 +372,8 @@ QCString convertCharEntitiesToUTF8(const QCString &s);
void
stackTrace
();
bool
readInputFile
(
const
char
*
fileName
,
BufStr
&
inBuf
);
bool
readInputFile
(
const
char
*
fileName
,
BufStr
&
inBuf
,
bool
filter
=
TRUE
,
bool
isSourceCode
=
FALSE
);
QCString
filterTitle
(
const
QCString
&
title
);
bool
patternMatch
(
const
QFileInfo
&
fi
,
const
QStrList
*
patList
);
...
...
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