00001 // -*- C++ -*- 00002 // 00003 // $Id: HTTP_Status.inl 90450 2010-06-08 07:25:58Z mcorino $ 00004 00005 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00006 00007 namespace ACE 00008 { 00009 namespace HTTP 00010 { 00011 ACE_INLINE 00012 void Status::set_status(Code status) 00013 { 00014 this->code_ = status; 00015 } 00016 00017 ACE_INLINE 00018 Status::Code Status::get_status() const 00019 { 00020 return this->code_; 00021 } 00022 00023 ACE_INLINE 00024 void Status::set_reason(const ACE_CString& reason) 00025 { 00026 this->reason_ = reason; 00027 } 00028 00029 ACE_INLINE 00030 const ACE_CString& Status::get_reason() const 00031 { 00032 return this->reason_; 00033 } 00034 00035 ACE_INLINE 00036 void Status::set_status_and_reason(Code status) 00037 { 00038 this->reason_ = get_reason (this->code_ = status); 00039 } 00040 00041 ACE_INLINE 00042 bool Status::is_valid () const 00043 { 00044 return this->code_ != INVALID; 00045 } 00046 00047 ACE_INLINE 00048 bool Status::is_ok () const 00049 { 00050 return this->code_ >= HTTP_OK && this->code_ < HTTP_BAD_REQUEST; 00051 } 00052 00053 ACE_INLINE 00054 Status::operator bool() const 00055 { 00056 return this->is_valid (); 00057 } 00058 00059 ACE_INLINE 00060 bool Status::operator !() const 00061 { 00062 return !this->is_valid (); 00063 } 00064 00065 } 00066 } 00067 00068 ACE_END_VERSIONED_NAMESPACE_DECL