Example #1
0
File: Date.cpp Project: juherr/fit
  void DATE::Parse(const STRING& aString) 
  {
    UErrorCode errorCode = U_ZERO_ERROR;

    UnicodeString formatSpec(L"d/M/yy K:mm a");
    SimpleDateFormat dateFormat(formatSpec, errorCode);
    if(U_FAILURE(errorCode))
    {
      STRING reason;
      SafeSprintf(reason, L"Failed to get a SimpleDateFormat for parse() in Date::Parse, reason (%i):  %S", errorCode, u_errorName(errorCode));
      throw new PARSEEXCEPTION(reason);
    }

    UnicodeString unicodeString(aString.GetBuffer());
    UDate uDate = dateFormat.parse(unicodeString, errorCode);
    if(U_FAILURE(errorCode))
    {
      STRING reason;
      SafeSprintf(reason, L"Parse exception in MUSIC::Parse, reason (%i):  %S", errorCode, u_errorName(errorCode));
      throw new PARSEEXCEPTION("Parse exception in MUSIC::Parse");
    }

    //delete dateFormat;
    Value = (fitINT64) uDate;
  }
Example #2
0
 void ceefit_call_spec OUTWRITER::Write(const STRING& aString)
 {
   if(IsClosed != true)
   {
     printf("%S", aString.GetBuffer());
   }
   else
   {
     throw new IOEXCEPTION("Bug:  OUTWRITER closed, should not write.");
   }
 }
Example #3
0
  // special form of exception for CeeFIT system failures
  void ceefit_call_spec FIXTURE::Failure(PTR<PARSE>& cell, FAILURE* f)
  {
    STRING message;

    message = STRING("A failure occurred:  ") + (f != null ? f->GetReason() : STRING("<unknown reason>"));
#   ifdef _DEBUG
      printf("%S\n", message.GetBuffer());
#   endif

    Error(cell, message);

    delete f;
  }
Example #4
0
  void ceefit_call_spec FIXTURE::Exception(PTR<PARSE>& cell, EXCEPTION* e)
  {
    STRING message;

    message = STRING("An unhandled exception occurred:  ") + (e != null ? e->GetReason() : STRING("<unknown reason>"));
#   ifdef _DEBUG
      printf("%S\n", message.GetBuffer());
#   endif

    Error(cell, message);

    delete e;
  }