~mterry/ubuntu/natty/libofx/libofx.new-upstream-benoit-sru

« back to all changes in this revision

Viewing changes to ofxconnect/ofxconnect.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Saïvann Carignan
  • Date: 2008-02-06 17:25:16 UTC
  • mto: (3.1.2 lenny)
  • mto: This revision was merged to the branch mainline in revision 11.
  • Revision ID: james.westby@ubuntu.com-20080206172516-bnzxb29igye8um9h
Tags: upstream-0.9.0
Import upstream version 0.9.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
210
210
  {
211
211
    cerr << "Statement request" << endl;
212
212
    
213
 
    OfxAccountInfo account;
214
 
    memset(&account,0,sizeof(OfxAccountInfo));
 
213
    OfxAccountData account;
 
214
    memset(&account,0,sizeof(OfxAccountData));
215
215
    
216
216
    if ( args_info.bank_given )
217
217
    {
218
218
      cerr << "bank " << args_info.bank_arg << endl;  
219
 
      strncpy(account.bankid,args_info.bank_arg,OFX_BANKID_LENGTH-1);
 
219
      strncpy(account.bank_id,args_info.bank_arg,OFX_BANKID_LENGTH-1);
220
220
    }
221
221
    else    
222
222
    {
230
230
    if ( args_info.broker_given )
231
231
    {
232
232
      cerr << "broker " << args_info.broker_arg << endl;  
233
 
      strncpy(account.brokerid,args_info.broker_arg,OFX_BROKERID_LENGTH-1);
 
233
      strncpy(account.broker_id,args_info.broker_arg,OFX_BROKERID_LENGTH-1);
234
234
    }
235
235
    else
236
236
    {
244
244
    if ( args_info.acct_given )
245
245
    {
246
246
      cerr << "acct " << args_info.acct_arg << endl;  
247
 
      strncpy(account.accountid,args_info.acct_arg,OFX_ACCOUNT_ID_LENGTH-1);
 
247
      strncpy(account.account_number,args_info.acct_arg,OFX_ACCTID_LENGTH-1);
248
248
    }
249
249
    else
250
250
    {
254
254
    
255
255
    if ( args_info.type_given )
256
256
    {
257
 
      cerr << "type " << args_info.type_arg << endl;  
258
 
      account.type = static_cast<AccountType>(args_info.type_arg);
 
257
      cerr << "type " << args_info.type_arg << endl;
 
258
      switch (args_info.type_arg) {
 
259
      case 1: account.account_type = account.OFX_CHECKING;
 
260
        break;
 
261
      case 2: account.account_type = account.OFX_INVESTMENT;
 
262
        break;
 
263
      case 3: account.account_type = account.OFX_CREDITCARD ;
 
264
        break;
 
265
      default:
 
266
        cerr << "ERROR: --type is not valid.  Must be between 1 and 3" << endl;
 
267
        ok = false;
 
268
      }
259
269
    }
260
270
    else
261
271
    {
325
335
  
326
336
  if ( args_info.payment_req_given )
327
337
  {
328
 
    OfxAccountInfo account;
329
 
    memset(&account,0,sizeof(OfxAccountInfo));
 
338
    OfxAccountData account;
 
339
    memset(&account,0,sizeof(OfxAccountData));
330
340
    OfxPayee payee;
331
341
    memset(&payee,0,sizeof(OfxPayee));
332
342
    OfxPayment payment;
349
359
    if ( args_info.bank_given )
350
360
    {
351
361
      cerr << "bank " << args_info.bank_arg << endl;  
352
 
      strncpy(account.bankid,args_info.bank_arg,OFX_BANKID_LENGTH-1);
 
362
      strncpy(account.bank_id,args_info.bank_arg,OFX_BANKID_LENGTH-1);
353
363
    }
354
364
    else    
355
365
    {
363
373
    if ( args_info.broker_given )
364
374
    {
365
375
      cerr << "broker " << args_info.broker_arg << endl;  
366
 
      strncpy(account.brokerid,args_info.broker_arg,OFX_BROKERID_LENGTH-1);
 
376
      strncpy(account.broker_id,args_info.broker_arg,OFX_BROKERID_LENGTH-1);
367
377
    }
368
378
    else
369
379
    {
377
387
    if ( args_info.acct_given )
378
388
    {
379
389
      cerr << "acct " << args_info.acct_arg << endl;  
380
 
      strncpy(account.accountid,args_info.acct_arg,OFX_ACCOUNT_ID_LENGTH-1);
 
390
      strncpy(account.account_number,args_info.acct_arg,OFX_ACCTID_LENGTH-1);
381
391
    }
382
392
    else
383
393
    {
386
396
    }
387
397
    
388
398
    if ( args_info.type_given )
389
 
    {
390
 
      cerr << "type " << args_info.type_arg << endl;  
391
 
      account.type = static_cast<AccountType>(args_info.type_arg);
 
399
    { 
 
400
      cerr << "type " << args_info.type_arg << endl;
 
401
      switch (args_info.type_arg) {
 
402
      case 1: account.account_type = account.OFX_CHECKING;
 
403
        break;
 
404
      case 2: account.account_type = account.OFX_INVESTMENT;
 
405
        break;
 
406
      case 3: account.account_type = account.OFX_CREDITCARD ;
 
407
        break;
 
408
      default:
 
409
        cerr << "ERROR: --type is not valid.  Must be between 1 and 3" << endl;
 
410
        ok = false;
 
411
      }
392
412
    }
393
413
    else
394
414
    {