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.
*
* This program is free software; you can redistribute it and/or
......@@ -35,9 +35,17 @@ extern "C" {
#include "cnv_changelog.h"
CnvChangeLog::CnvChangeLog( CnvCtx *cnv_ctx) :
ctx(cnv_ctx)
CnvChangeLog::CnvChangeLog( CnvCtx *cnv_ctx, char *from_str) :
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( "xtt");
read( "wb");
......@@ -218,6 +226,11 @@ void CnvChangeLog::print()
sort_time();
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));
timstr1[11] = 0;
......@@ -266,6 +279,11 @@ void CnvChangeLog::print_docbook()
"<td><classname>Change</classname></td></tr>" << endl;
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));
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.
*
* This program is free software; you can redistribute it and/or
......@@ -71,8 +71,11 @@ class CnvChangeLog {
public:
vector<LogEntry> entries;
CnvCtx *ctx;
int from;
pwr_tTime from_time;
CnvChangeLog( CnvCtx *cnv_ctx);
CnvChangeLog( CnvCtx *cnv_ctx, char *from_str);
int read( char *module);
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.
*
* This program is free software; you can redistribute it and/or
......@@ -127,6 +127,7 @@ int main( int argc, char *argv[])
int xtthelp_to_ps = 0;
int xtthelp_to_pdf = 0;
int changelog = 0;
char from[80] = "";
if ( argc < 2 || argc > 9) {
usage();
......@@ -170,60 +171,71 @@ int main( int argc, char *argv[])
i++;
}
else if ( argv[i][0] == '-') {
int next = 0;
s = &argv[i][1];
while( *s) {
switch( *s) {
case 'h':
help();
exit(0);
case 'w':
ctx->generate_html = 1;
break;
case 'x':
ctx->generate_xtthelp = 1;
break;
case 'c':
ctx->generate_src = 1;
break;
case 's':
ctx->generate_struct = 1;
break;
case 'q':
ctx->generate_ps = 1;
ctx->common_structfile_only = 1;
break;
case 'p':
ctx->generate_struct = 1;
ctx->hpp = 1;
break;
case 'o':
ctx->common_structfile_only = 1;
break;
case 'k':
ctx->generate_cdp = 1;
break;
case 'v':
ctx->verbose = 1;
break;
case 't':
xtthelp_to_html = 1;
break;
case 'm':
xtthelp_to_xml = 1;
break;
case 'n':
xtthelp_to_ps = 1;
break;
case 'f':
xtthelp_to_pdf = 1;
break;
case 'e':
changelog = 1;
case 'h':
help();
exit(0);
case 'w':
ctx->generate_html = 1;
break;
case 'x':
ctx->generate_xtthelp = 1;
break;
case 'c':
ctx->generate_src = 1;
break;
case 's':
ctx->generate_struct = 1;
break;
case 'q':
ctx->generate_ps = 1;
ctx->common_structfile_only = 1;
break;
case 'p':
ctx->generate_struct = 1;
ctx->hpp = 1;
break;
case 'o':
ctx->common_structfile_only = 1;
break;
case 'k':
ctx->generate_cdp = 1;
break;
case 'v':
ctx->verbose = 1;
break;
case 't':
xtthelp_to_html = 1;
break;
case 'm':
xtthelp_to_xml = 1;
break;
case 'n':
xtthelp_to_ps = 1;
break;
default:
usage();
exit(0);
case 'f':
xtthelp_to_pdf = 1;
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++;
}
}
......@@ -237,7 +249,7 @@ int main( int argc, char *argv[])
}
if ( changelog) {
CnvChangeLog *c = new CnvChangeLog( ctx);
CnvChangeLog *c = new CnvChangeLog( ctx, from);
delete c;
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