*** empty log message ***
This commit is contained in:
parent
d9deab6f53
commit
f621d3704b
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.22 2007-09-08 17:25:49 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: uiprefs_w.cpp,v 1.23 2007-12-04 10:16:52 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -302,12 +302,11 @@ void UIPrefsDialog::showViewAction()
|
|||||||
{
|
{
|
||||||
if (m_viewAction== 0) {
|
if (m_viewAction== 0) {
|
||||||
m_viewAction = new ViewAction(0);
|
m_viewAction = new ViewAction(0);
|
||||||
m_viewAction->show();
|
|
||||||
} else {
|
} else {
|
||||||
// Close and reopen, in hope that makes us visible...
|
// Close and reopen, in hope that makes us visible...
|
||||||
m_viewAction->close();
|
m_viewAction->close();
|
||||||
m_viewAction->show();
|
|
||||||
}
|
}
|
||||||
|
m_viewAction->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////
|
////////////////////////////////////////////
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#ifndef lint
|
||||||
static char rcsid[] = "@(#$Id: utf8iter.cpp,v 1.5 2006-11-20 11:16:54 dockes Exp $ (C) 2005 J.F.Dockes";
|
static char rcsid[] = "@(#$Id: utf8iter.cpp,v 1.6 2007-12-04 10:16:27 dockes Exp $ (C) 2005 J.F.Dockes";
|
||||||
#endif
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -35,14 +35,43 @@ using namespace std;
|
|||||||
#include "utf8iter.h"
|
#include "utf8iter.h"
|
||||||
#include "readfile.h"
|
#include "readfile.h"
|
||||||
|
|
||||||
|
const char *thisprog;
|
||||||
|
static char usage [] =
|
||||||
|
"utf8iter [opts] infile outfile\n"
|
||||||
|
" converts infile to 32 bits unicode (processor order), for testing\n"
|
||||||
|
"-v : print stuff as we go\n"
|
||||||
|
;
|
||||||
|
|
||||||
|
void Usage() {
|
||||||
|
fprintf(stderr, "%s:%s\n", thisprog, usage);
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
static int op_flags;
|
||||||
|
#define OPT_v 0x2
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
if (argc != 3) {
|
thisprog = argv[0];
|
||||||
cerr << "Usage: utf8iter infile outfile" << endl;
|
argc--; argv++;
|
||||||
exit(1);
|
|
||||||
|
while (argc > 0 && **argv == '-') {
|
||||||
|
(*argv)++;
|
||||||
|
if (!(**argv))
|
||||||
|
Usage();
|
||||||
|
while (**argv)
|
||||||
|
switch (*(*argv)++) {
|
||||||
|
case 'v': op_flags |= OPT_v; break;
|
||||||
|
|
||||||
|
default: Usage(); break;
|
||||||
|
}
|
||||||
|
argc--;argv++;
|
||||||
}
|
}
|
||||||
const char *infile = argv[1];
|
|
||||||
const char *outfile = argv[2];
|
if (argc != 2) {
|
||||||
|
Usage();
|
||||||
|
}
|
||||||
|
const char *infile = *argv++;argc--;
|
||||||
|
const char *outfile = *argv++;argc--;
|
||||||
string in;
|
string in;
|
||||||
if (!file_to_string(infile, in)) {
|
if (!file_to_string(infile, in)) {
|
||||||
cerr << "Cant read file\n" << endl;
|
cerr << "Cant read file\n" << endl;
|
||||||
@ -62,9 +91,15 @@ int main(int argc, char **argv)
|
|||||||
for (;!it.eof(); it++) {
|
for (;!it.eof(); it++) {
|
||||||
unsigned int value = *it;
|
unsigned int value = *it;
|
||||||
if (value == (unsigned int)-1) {
|
if (value == (unsigned int)-1) {
|
||||||
fprintf(stderr, "Conversion error occurred\n");
|
cerr << "Conversion error occurred\n" << endl;
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
if (op_flags & OPT_v) {
|
||||||
|
printf("Value: 0x%x", value);
|
||||||
|
if (value < 0x7f)
|
||||||
|
printf(" (%c) ", value);
|
||||||
|
printf("\n");
|
||||||
|
}
|
||||||
// UTF-32LE or BE array
|
// UTF-32LE or BE array
|
||||||
ucsout1.push_back(value);
|
ucsout1.push_back(value);
|
||||||
// UTF-32LE or BE file
|
// UTF-32LE or BE file
|
||||||
@ -140,4 +175,3 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user