Changeset 24040

Show
Ignore:
Timestamp:
19.05.2011 10:52:11 (8 years ago)
Author:
jmt12
Message:

Removing extra whitespace and minor code style reformatting

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs2-extensions/tdb-edit/trunk/src/src/txt2tdb-src/txt2tdb.cpp

    r23996 r24040  
    55 * 
    66 * A component of the Greenstone digital library software 
    7  * from the New Zealand Digital Library Project at the  
     7 * from the New Zealand Digital Library Project at the 
    88 * University of Waikato, New Zealand. 
    99 * 
    1010 * Copyright (C) 2011  The New Zealand Digital Library Project 
    11  *  
     11 * 
    1212 * This program is free software; you can redistribute it and/or modify 
    1313 * it under the terms of the GNU General Public License as published by 
     
    6464    exit (0); 
    6565  } 
    66    
     66 
    6767  char *dbname; 
    6868  int append = 0; 
     
    7474      append = 1; 
    7575      dbname = argv[2]; 
    76     }  
     76    } 
    7777    else 
    7878    { 
     
    8686    dbname = argv[1]; 
    8787  } 
    88    
     88 
    8989  // open the database 
    9090  int hash_size = 0; 
     
    102102    exit (0); 
    103103  } 
    104    
     104 
    105105  char c; 
    106106  cin.get(c); 
     
    110110    text_t key = ""; 
    111111    text_t value = ""; 
    112      
     112 
    113113    // Parse out 'key' from [key]\n 
    114114    //  - scan for first occurrence of [ 
     
    133133      // is to be deleted, not added 
    134134      cin.get(c); 
    135       if (c == '-') {    
     135      if (c == '-') 
     136      { 
    136137        delkey = 1; 
    137138      } 
    138       else { 
     139      else 
     140      { 
    139141        delkey = 0; 
    140142      } 
     
    151153      { 
    152154        tmp.push_back ((unsigned char)c); 
    153         num_dashes = 0;  
     155        num_dashes = 0; 
    154156      } 
    155157      else if (c == '\r') 
    156       {  
    157         // Here we are able to process both Windows-specific text files  
    158         // (containing carriage-return, newline) and Linux text files  
    159         // (containing only newline characters) by ignoring the Windows'  
     158      { 
     159        // Here we are able to process both Windows-specific text files 
     160        // (containing carriage-return, newline) and Linux text files 
     161        // (containing only newline characters) by ignoring the Windows' 
    160162        // carriage-return altogether so that we produce a uniform database 
    161         // file from either system's type of text file.  
     163        // file from either system's type of text file. 
    162164        // If we don't ignore the carriage return here, txt.gz files 
    163165        // produced on Windows cause a GS library running on Linux to break. 
     
    178180      cin.get(c); 
    179181    } 
    180      
     182 
    181183    // We should now have a key/value pair. If the key is not an empty string 
    182184    // store this key-value pair 
     
    231233    exit (0); 
    232234  } 
    233    
     235 
    234236  return 0; 
    235237}