* followed advice by Rene to explicitly import the used std-classes instead
of simply importing the whole namespace - thanks for proofreading! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30568 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -31,11 +31,11 @@ struct hash<BPrivate::CatKey> {
|
|||||||
#if __GNUC__ > 2
|
#if __GNUC__ > 2
|
||||||
} // namespace __gnu_cxx
|
} // namespace __gnu_cxx
|
||||||
|
|
||||||
using namespace __gnu_cxx;
|
using __gnu_cxx::hash;
|
||||||
|
using __gnu_cxx::hash_map;
|
||||||
|
using __gnu_cxx::equal_to;
|
||||||
#endif // __GNUC__ > 2
|
#endif // __GNUC__ > 2
|
||||||
|
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
namespace BPrivate {
|
namespace BPrivate {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
/*
|
/*
|
||||||
** Copyright 2003, Oliver Tappe, [email protected]. All rights reserved.
|
** Copyright 2003, Oliver Tappe, [email protected]. All rights reserved.
|
||||||
** Distributed under the terms of the OpenBeOS License.
|
** Distributed under the terms of the OpenBeOS License.
|
||||||
*/
|
*/
|
||||||
@@ -13,8 +13,10 @@
|
|||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
void
|
void
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
fprintf(stderr,
|
fprintf(stderr,
|
||||||
"usage: linkcatkeys [-v] [-t(a|f|r)] [-o <outfile>] [-l <catalogLang>]\n"
|
"usage: linkcatkeys [-v] [-t(a|f|r)] [-o <outfile>] [-l <catalogLang>]\n"
|
||||||
@@ -80,17 +82,17 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
if (inputFiles.empty() || !catalogSig || !outputFile.Length())
|
if (inputFiles.empty() || !catalogSig || !outputFile.Length())
|
||||||
usage();
|
usage();
|
||||||
|
|
||||||
EditableCatalog targetCatalog("Default", catalogSig, catalogLang);
|
EditableCatalog targetCatalog("Default", catalogSig, catalogLang);
|
||||||
if ((res = targetCatalog.InitCheck()) != B_OK) {
|
if ((res = targetCatalog.InitCheck()) != B_OK) {
|
||||||
fprintf(stderr, "couldn't construct target-catalog %s - error: %s\n",
|
fprintf(stderr, "couldn't construct target-catalog %s - error: %s\n",
|
||||||
outputFile.String(), strerror(res));
|
outputFile.String(), strerror(res));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
DefaultCatalog* targetCatImpl
|
DefaultCatalog* targetCatImpl
|
||||||
= dynamic_cast<DefaultCatalog*>(targetCatalog.CatalogAddOn());
|
= dynamic_cast<DefaultCatalog*>(targetCatalog.CatalogAddOn());
|
||||||
if (!targetCatImpl) {
|
if (!targetCatImpl) {
|
||||||
fprintf(stderr, "couldn't access impl of target-catalog %s\n",
|
fprintf(stderr, "couldn't access impl of target-catalog %s\n",
|
||||||
outputFile.String());
|
outputFile.String());
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@@ -99,14 +101,14 @@ main(int argc, char **argv)
|
|||||||
for( uint32 i=0; i<count; ++i) {
|
for( uint32 i=0; i<count; ++i) {
|
||||||
EditableCatalog inputCatalog("Default", catalogSig, "native");
|
EditableCatalog inputCatalog("Default", catalogSig, "native");
|
||||||
if ((res = inputCatalog.ReadFromFile(inputFiles[i])) != B_OK) {
|
if ((res = inputCatalog.ReadFromFile(inputFiles[i])) != B_OK) {
|
||||||
fprintf(stderr, "couldn't load target-catalog %s - error: %s\n",
|
fprintf(stderr, "couldn't load target-catalog %s - error: %s\n",
|
||||||
inputFiles[i], strerror(res));
|
inputFiles[i], strerror(res));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
DefaultCatalog* inputCatImpl
|
DefaultCatalog* inputCatImpl
|
||||||
= dynamic_cast<DefaultCatalog*>(inputCatalog.CatalogAddOn());
|
= dynamic_cast<DefaultCatalog*>(inputCatalog.CatalogAddOn());
|
||||||
if (!inputCatImpl) {
|
if (!inputCatImpl) {
|
||||||
fprintf(stderr, "couldn't access impl of input-catalog %s\n",
|
fprintf(stderr, "couldn't access impl of input-catalog %s\n",
|
||||||
inputFiles[i]);
|
inputFiles[i]);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@@ -116,7 +118,7 @@ main(int argc, char **argv)
|
|||||||
// but this should be fast enough).
|
// but this should be fast enough).
|
||||||
DefaultCatalog::CatWalker walker;
|
DefaultCatalog::CatWalker walker;
|
||||||
if ((res = inputCatImpl->GetWalker(&walker)) != B_OK) {
|
if ((res = inputCatImpl->GetWalker(&walker)) != B_OK) {
|
||||||
fprintf(stderr, "couldn't get walker for input-catalog %s - error: %s\n",
|
fprintf(stderr, "couldn't get walker for input-catalog %s - error: %s\n",
|
||||||
inputFiles[i], strerror(res));
|
inputFiles[i], strerror(res));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@@ -135,7 +137,7 @@ main(int argc, char **argv)
|
|||||||
entry.GetRef(&eref);
|
entry.GetRef(&eref);
|
||||||
res = targetCatalog.WriteToAttribute(&eref);
|
res = targetCatalog.WriteToAttribute(&eref);
|
||||||
if (res != B_OK) {
|
if (res != B_OK) {
|
||||||
fprintf(stderr, "couldn't write target-attribute to %s - error: %s\n",
|
fprintf(stderr, "couldn't write target-attribute to %s - error: %s\n",
|
||||||
outputFile.String(), strerror(res));
|
outputFile.String(), strerror(res));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@@ -147,7 +149,7 @@ main(int argc, char **argv)
|
|||||||
entry.GetRef(&eref);
|
entry.GetRef(&eref);
|
||||||
res = targetCatalog.WriteToResource(&eref);
|
res = targetCatalog.WriteToResource(&eref);
|
||||||
if (res != B_OK) {
|
if (res != B_OK) {
|
||||||
fprintf(stderr, "couldn't write target-resource to %s - error: %s\n",
|
fprintf(stderr, "couldn't write target-resource to %s - error: %s\n",
|
||||||
outputFile.String(), strerror(res));
|
outputFile.String(), strerror(res));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
@@ -155,7 +157,7 @@ main(int argc, char **argv)
|
|||||||
default: {
|
default: {
|
||||||
res = targetCatalog.WriteToFile(outputFile.String());
|
res = targetCatalog.WriteToFile(outputFile.String());
|
||||||
if (res != B_OK) {
|
if (res != B_OK) {
|
||||||
fprintf(stderr, "couldn't write target-catalog to %s - error: %s\n",
|
fprintf(stderr, "couldn't write target-catalog to %s - error: %s\n",
|
||||||
outputFile.String(), strerror(res));
|
outputFile.String(), strerror(res));
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,12 @@
|
|||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
|
||||||
|
using std::auto_ptr;
|
||||||
|
using std::min;
|
||||||
|
using std::max;
|
||||||
|
using std::pair;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file implements the default catalog-type for the opentracker locale kit.
|
* This file implements the default catalog-type for the opentracker locale kit.
|
||||||
* Alternatively, this could be used as a full add-on, but currently this
|
* Alternatively, this could be used as a full add-on, but currently this
|
||||||
|
|||||||
Reference in New Issue
Block a user