Commit f78cc2ab authored by claes's avatar claes

Switch --from added

parent 9354a2e9
/* /*
* Proview $Id: cnv_changelog.cpp,v 1.3 2006-09-07 14:03:02 claes Exp $ * Proview $Id: cnv_changelog.cpp,v 1.4 2007-01-23 13:11:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -35,9 +35,17 @@ extern "C" { ...@@ -35,9 +35,17 @@ extern "C" {
#include "cnv_changelog.h" #include "cnv_changelog.h"
CnvChangeLog::CnvChangeLog( CnvCtx *cnv_ctx) : CnvChangeLog::CnvChangeLog( CnvCtx *cnv_ctx, char *from_str) :
ctx(cnv_ctx) ctx(cnv_ctx), from(0)
{ {
pwr_tStatus sts;
if ( strcmp( from_str, "") != 0) {
sts = time_AsciiToA( from_str, &from_time);
if ( ODD( sts))
from = 1;
}
read( "src"); read( "src");
read( "xtt"); read( "xtt");
read( "wb"); read( "wb");
...@@ -218,6 +226,11 @@ void CnvChangeLog::print() ...@@ -218,6 +226,11 @@ void CnvChangeLog::print()
sort_time(); sort_time();
for ( int i = 0; i < (int) entries.size(); i++) { for ( int i = 0; i < (int) entries.size(); i++) {
if ( from) {
if ( time_Acomp( &entries[i].time, &from_time) < 0)
continue;
}
time_AtoAscii( &entries[i].time, time_eFormat_DateAndTime, timstr1, sizeof(timstr1)); time_AtoAscii( &entries[i].time, time_eFormat_DateAndTime, timstr1, sizeof(timstr1));
timstr1[11] = 0; timstr1[11] = 0;
...@@ -266,6 +279,11 @@ void CnvChangeLog::print_docbook() ...@@ -266,6 +279,11 @@ void CnvChangeLog::print_docbook()
"<td><classname>Change</classname></td></tr>" << endl; "<td><classname>Change</classname></td></tr>" << endl;
for ( int i = (int) entries.size() - 1; i >= 0; i--) { for ( int i = (int) entries.size() - 1; i >= 0; i--) {
if ( from) {
if ( time_Acomp( &entries[i].time, &from_time) < 0)
continue;
}
time_AtoAscii( &entries[i].time, time_eFormat_DateAndTime, timstr1, sizeof(timstr1)); time_AtoAscii( &entries[i].time, time_eFormat_DateAndTime, timstr1, sizeof(timstr1));
timstr1[11] = 0; timstr1[11] = 0;
......
/* /*
* Proview $Id: cnv_changelog.h,v 1.2 2006-05-22 13:31:41 claes Exp $ * Proview $Id: cnv_changelog.h,v 1.3 2007-01-23 13:11:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -71,8 +71,11 @@ class CnvChangeLog { ...@@ -71,8 +71,11 @@ class CnvChangeLog {
public: public:
vector<LogEntry> entries; vector<LogEntry> entries;
CnvCtx *ctx; CnvCtx *ctx;
int from;
pwr_tTime from_time;
CnvChangeLog( CnvCtx *cnv_ctx); CnvChangeLog( CnvCtx *cnv_ctx, char *from_str);
int read( char *module); int read( char *module);
void print(); void print();
......
/* /*
* Proview $Id: co_convert.cpp,v 1.12 2006-07-03 05:09:48 claes Exp $ * Proview $Id: co_convert.cpp,v 1.13 2007-01-23 13:11:43 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -127,6 +127,7 @@ int main( int argc, char *argv[]) ...@@ -127,6 +127,7 @@ int main( int argc, char *argv[])
int xtthelp_to_ps = 0; int xtthelp_to_ps = 0;
int xtthelp_to_pdf = 0; int xtthelp_to_pdf = 0;
int changelog = 0; int changelog = 0;
char from[80] = "";
if ( argc < 2 || argc > 9) { if ( argc < 2 || argc > 9) {
usage(); usage();
...@@ -170,60 +171,71 @@ int main( int argc, char *argv[]) ...@@ -170,60 +171,71 @@ int main( int argc, char *argv[])
i++; i++;
} }
else if ( argv[i][0] == '-') { else if ( argv[i][0] == '-') {
int next = 0;
s = &argv[i][1]; s = &argv[i][1];
while( *s) { while( *s) {
switch( *s) { switch( *s) {
case 'h': case 'h':
help(); help();
exit(0); exit(0);
case 'w': case 'w':
ctx->generate_html = 1; ctx->generate_html = 1;
break; break;
case 'x': case 'x':
ctx->generate_xtthelp = 1; ctx->generate_xtthelp = 1;
break; break;
case 'c': case 'c':
ctx->generate_src = 1; ctx->generate_src = 1;
break; break;
case 's': case 's':
ctx->generate_struct = 1; ctx->generate_struct = 1;
break; break;
case 'q': case 'q':
ctx->generate_ps = 1; ctx->generate_ps = 1;
ctx->common_structfile_only = 1; ctx->common_structfile_only = 1;
break; break;
case 'p': case 'p':
ctx->generate_struct = 1; ctx->generate_struct = 1;
ctx->hpp = 1; ctx->hpp = 1;
break; break;
case 'o': case 'o':
ctx->common_structfile_only = 1; ctx->common_structfile_only = 1;
break; break;
case 'k': case 'k':
ctx->generate_cdp = 1; ctx->generate_cdp = 1;
break; break;
case 'v': case 'v':
ctx->verbose = 1; ctx->verbose = 1;
break; break;
case 't': case 't':
xtthelp_to_html = 1; xtthelp_to_html = 1;
break; break;
case 'm': case 'm':
xtthelp_to_xml = 1; xtthelp_to_xml = 1;
break; break;
case 'n': case 'n':
xtthelp_to_ps = 1; xtthelp_to_ps = 1;
break;
case 'f':
xtthelp_to_pdf = 1;
break;
case 'e':
changelog = 1;
break; break;
default: case 'f':
usage(); xtthelp_to_pdf = 1;
exit(0); break;
case 'e':
changelog = 1;
break;
case '-': {
if ( strcmp( s, "-from") == 0 && ( i+1 < argc)) {
strcpy( from, argv[i+1]);
next = 1;
i++;
}
break;
}
default:
usage();
exit(0);
} }
if ( next)
break;
s++; s++;
} }
} }
...@@ -237,7 +249,7 @@ int main( int argc, char *argv[]) ...@@ -237,7 +249,7 @@ int main( int argc, char *argv[])
} }
if ( changelog) { if ( changelog) {
CnvChangeLog *c = new CnvChangeLog( ctx); CnvChangeLog *c = new CnvChangeLog( ctx, from);
delete c; delete c;
exit(0); exit(0);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment