Ignore:
Timestamp:
Oct 23, 2013 5:34:48 AM (11 years ago)
Author:
bennylp
Message:

More re #1519:

  • account API implementation (incomplete, callback is still not called)
  • using callback class design pattern (observer?)
  • after this, it might be changed to use inheritance pattern instead
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/pjsua2/pjsip/src/pjsua2/types.cpp

    r4608 r4631  
    4545} 
    4646 
     47string Error::info(bool multi_line) const 
     48{ 
     49    string output; 
     50 
     51    if (status==PJ_SUCCESS) { 
     52        output = "No error"; 
     53    } else if (!multi_line) { 
     54        char temp[80]; 
     55 
     56        if (!title.empty()) { 
     57            output += title + " error: "; 
     58        } 
     59        snprintf(temp, sizeof(temp), " (status=%d)", status); 
     60        output += reason + temp; 
     61        if (!srcFile.empty()) { 
     62            output += " ["; 
     63            output += srcFile; 
     64            snprintf(temp, sizeof(temp), ":%d]", srcLine); 
     65            output += temp; 
     66        } 
     67    } else { 
     68        char temp[80]; 
     69 
     70        if (!title.empty()) { 
     71            output += string("Title:       ") + title + "\n"; 
     72        } 
     73 
     74        snprintf(temp, sizeof(temp), "%d\n", status); 
     75        output += string("Code:        ") + temp; 
     76        output += string("Description: ") + reason + "\n"; 
     77        if (!srcFile.empty()) { 
     78            snprintf(temp, sizeof(temp), ":%d\n", srcLine); 
     79            output += string("Location:    ") + srcFile + temp; 
     80        } 
     81    } 
     82 
     83    return output; 
     84} 
     85 
     86/////////////////////////////////////////////////////////////////////////////// 
     87 
     88AuthCredInfo::AuthCredInfo() 
     89: dataType(0) 
     90{ 
     91} 
     92 
     93AuthCredInfo::AuthCredInfo(const string &param_scheme, 
     94                           const string &param_realm, 
     95                           const string &param_user_name, 
     96                           const int param_data_type, 
     97                           const string param_data) 
     98: scheme(param_scheme), realm(param_realm), username(param_user_name), 
     99  dataType(param_data_type), data(param_data) 
     100{ 
     101} 
     102 
    47103 
    48104/////////////////////////////////////////////////////////////////////////////// 
Note: See TracChangeset for help on using the changeset viewer.