Commit 5cc8d461 authored by Claes Sjofors's avatar Claes Sjofors

Ge and glow read pwg-files, improved error handling

parent fab7ead2
This diff is collapsed.
......@@ -52,6 +52,12 @@ void GlowAnnot::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowAnnot: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Annot: break;
......
......@@ -68,6 +68,12 @@ void GlowArc::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowArc: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Arc: break;
......
......@@ -843,6 +843,12 @@ void GlowArray::open( GrowCtx *ctx, ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowArray: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Array: break;
......
......@@ -832,6 +832,12 @@ void GlowCon::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowCon: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Con: break;
......
......@@ -64,6 +64,12 @@ void GlowConClass::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowConClass: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_ConClass: break;
......
......@@ -65,6 +65,12 @@ void GlowConPoint::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowConPoint: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_ConPoint: break;
......
......@@ -291,6 +291,12 @@ int GlowCtx::open( char *filename, glow_eSaveMode mode)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowCtx: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Ctx: break;
......
......@@ -57,6 +57,12 @@ void GrowAnnot::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowAnnot: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowAnnot: break;
......
......@@ -306,6 +306,12 @@ void GrowArc::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowArc: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowArc: break;
......
......@@ -95,6 +95,12 @@ void GrowAxis::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowAxis: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowAxis: break;
......
......@@ -98,6 +98,12 @@ void GrowBar::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowBar: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowBar: break;
......
......@@ -239,6 +239,12 @@ void GrowConGlue::open( ifstream& fp)
char dummy[40];
for (;;) {
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowConGlue: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowConGlue: break;
......
......@@ -243,6 +243,12 @@ void GrowConPoint::open( ifstream& fp)
char dummy[40];
for (;;) {
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowConPoint: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowConPoint: break;
......
......@@ -1982,6 +1982,12 @@ void GrowCtx::open_grow( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowCtx: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowCtx: break;
......
......@@ -96,6 +96,12 @@ void GrowFolder::open( ifstream& fp)
int tmp;
for (;;) {
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowFolder: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowFolder: break;
......
......@@ -108,6 +108,12 @@ void GrowGroup::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowGroup: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowGroup: break;
......
......@@ -464,6 +464,12 @@ void GrowImage::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowImage: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowImage: break;
......
......@@ -303,6 +303,12 @@ void GrowLine::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowLine: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowLine: break;
......
......@@ -201,6 +201,12 @@ void GrowNode::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowNode: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowNode: break;
......
......@@ -878,6 +878,12 @@ void GrowPolyLine::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowPolyLine: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowPolyLine: break;
......
......@@ -320,6 +320,12 @@ void GrowRect::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowLine: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowRect: break;
......
......@@ -305,6 +305,12 @@ void GrowRectRounded::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowRectRounded: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowRectRounded: break;
......
......@@ -79,6 +79,12 @@ void GrowSlider::open( ifstream& fp)
int tmp;
for (;;) {
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowSlider: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowSlider: break;
......
......@@ -269,6 +269,12 @@ void GrowSubAnnot::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowSubAnnot: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowSubAnnot: break;
......
......@@ -127,6 +127,12 @@ void GrowTable::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowTable: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowTable: break;
......
......@@ -281,6 +281,12 @@ void GrowText::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowText: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowText: break;
......
......@@ -218,6 +218,12 @@ void GrowTrend::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowTrend: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowTrend: break;
......
......@@ -99,6 +99,12 @@ void GrowWindow::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowWindow: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowWindow: break;
......
......@@ -61,6 +61,12 @@ void GrowXYCurve::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GrowXYWindow: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_GrowXYCurve: break;
......
......@@ -71,6 +71,12 @@ void GlowLine::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowLine: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Line: break;
......
......@@ -191,6 +191,12 @@ void GlowNode::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowNode: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Node: break;
......
......@@ -164,6 +164,12 @@ void GlowNodeClass::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowNodeClass: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_NodeClass: break;
......
......@@ -82,6 +82,12 @@ void GlowNodeGroup::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowNodeGroup: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_NodeGroup: break;
......
......@@ -89,6 +89,12 @@ void GlowPoint::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowPoint: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Point: break;
......
......@@ -102,6 +102,12 @@ void GlowPolyLine::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowPolyLine: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_PolyLine: break;
......
......@@ -72,6 +72,12 @@ void GlowRect::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowRect: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Rect: break;
......
......@@ -67,6 +67,12 @@ void GlowText::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowText: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Text: break;
......
......@@ -213,6 +213,12 @@ void GlowTransform::open( ifstream& fp)
for (;;)
{
if ( !fp.good()) {
fp.clear();
fp.getline( dummy, sizeof(dummy));
printf( "** Read error GlowTransform: \"%d %s\"\n", type, dummy);
}
fp >> type;
switch( type) {
case glow_eSave_Transform: break;
......
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