projects
/
platform
/
upstream
/
doxygen.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 1.9.8
[platform/upstream/doxygen.git]
/
src
/
resourcemgr.cpp
diff --git
a/src/resourcemgr.cpp
b/src/resourcemgr.cpp
index
c6db5d3
..
a6f4a5c
100644
(file)
--- a/
src/resourcemgr.cpp
+++ b/
src/resourcemgr.cpp
@@
-15,13
+15,14
@@
#include <map>
#include <string.h>
#include <map>
#include <string.h>
-#include <
fstream
>
+#include <
cstdint
>
#include "resourcemgr.h"
#include "util.h"
#include "version.h"
#include "message.h"
#include "config.h"
#include "resourcemgr.h"
#include "util.h"
#include "version.h"
#include "message.h"
#include "config.h"
+#include "portable.h"
class ResourceMgr::Private
{
class ResourceMgr::Private
{
@@
-53,13
+54,12
@@
void ResourceMgr::registerResources(std::initializer_list<Resource> resources)
bool ResourceMgr::writeCategory(const QCString &categoryName,const QCString &targetDir) const
{
bool ResourceMgr::writeCategory(const QCString &categoryName,const QCString &targetDir) const
{
- for (auto &
kv
: p->resources)
+ for (auto &
[name,res]
: p->resources)
{
{
- Resource &res = kv.second;
if (res.category==categoryName)
{
if (res.category==categoryName)
{
-
std::string pathName = targetDir.str()
+"/"+res.name;
- std::ofstream f
(pathName,std::ofstream::out | std::ofstream::binary
);
+
QCString pathName = targetDir
+"/"+res.name;
+ std::ofstream f
= Portable::openOutputStream(pathName
);
bool ok=false;
if (f.is_open())
{
bool ok=false;
if (f.is_open())
{
@@
-78,9
+78,7
@@
bool ResourceMgr::writeCategory(const QCString &categoryName,const QCString &tar
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName,bool append) const
{
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,const QCString &targetName,bool append) const
{
- std::string pathName = targetDir.str()+"/"+targetName.str();
- std::ios_base::openmode mode = std::ofstream::out | std::ofstream::binary;
- if (append) mode |= std::ofstream::app;
+ QCString pathName = targetDir+"/"+targetName;
const Resource *res = get(name);
if (res)
{
const Resource *res = get(name);
if (res)
{
@@
-88,7
+86,7
@@
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,
{
case Resource::Verbatim:
{
{
case Resource::Verbatim:
{
- std::ofstream f
(pathName,mode
);
+ std::ofstream f
= Portable::openOutputStream(pathName,append
);
bool ok=false;
if (f.is_open())
{
bool ok=false;
if (f.is_open())
{
@@
-105,9
+103,9
@@
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,
{
QCString n = name;
n = n.left(n.length()-4)+".png"; // replace .lum by .png
{
QCString n = name;
n = n.left(n.length()-4)+".png"; // replace .lum by .png
- const u
char
*data = res->data;
- u
shor
t width = (data[0]<<8)+data[1];
- u
shor
t height = (data[2]<<8)+data[3];
+ const u
int8_t
*data = res->data;
+ u
int16_
t width = (data[0]<<8)+data[1];
+ u
int16_
t height = (data[2]<<8)+data[3];
ColoredImgDataItem images[2];
images[0].name = n.data();
images[0].width = width;
ColoredImgDataItem images[2];
images[0].name = n.data();
images[0].width = width;
@@
-123,9
+121,9
@@
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,
{
QCString n = name;
n = n.left(n.length()-5)+".png"; // replace .luma by .png
{
QCString n = name;
n = n.left(n.length()-5)+".png"; // replace .luma by .png
- const u
char
*data = res->data;
- u
shor
t width = (data[0]<<8)+data[1];
- u
shor
t height = (data[2]<<8)+data[3];
+ const u
int8_t
*data = res->data;
+ u
int16_
t width = (data[0]<<8)+data[1];
+ u
int16_
t height = (data[2]<<8)+data[3];
ColoredImgDataItem images[2];
images[0].name = n.data();
images[0].width = width;
ColoredImgDataItem images[2];
images[0].name = n.data();
images[0].width = width;
@@
-139,7
+137,7
@@
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,
break;
case Resource::CSS:
{
break;
case Resource::CSS:
{
- std::ofstream t
(pathName,mode
);
+ std::ofstream t
= Portable::openOutputStream(pathName,append
);
if (t.is_open())
{
QCString buf(res->size+1);
if (t.is_open())
{
QCString buf(res->size+1);
@@
-159,7
+157,7
@@
bool ResourceMgr::copyResourceAs(const QCString &name,const QCString &targetDir,
break;
case Resource::SVG:
{
break;
case Resource::SVG:
{
- std::ofstream t
(pathName,mode
);
+ std::ofstream t
= Portable::openOutputStream(pathName,append
);
if (t.is_open())
{
QCString buf(res->size+1);
if (t.is_open())
{
QCString buf(res->size+1);