comparison Core/Toolbox.cpp @ 477:6f8ae46ed90e

moves
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 15 Jul 2013 21:27:49 +0200
parents a9693dc7089c
children 8c3573d28868
comparison
equal deleted inserted replaced
476:4aae0261515e 477:6f8ae46ed90e
695 695
696 default: 696 default:
697 throw OrthancException(ErrorCode_NotImplemented); 697 throw OrthancException(ErrorCode_NotImplemented);
698 } 698 }
699 } 699 }
700
701
702 const char* Toolbox::ToString(HttpMethod method)
703 {
704 switch (method)
705 {
706 case HttpMethod_Get:
707 return "GET";
708
709 case HttpMethod_Post:
710 return "POST";
711
712 case HttpMethod_Delete:
713 return "DELETE";
714
715 case HttpMethod_Put:
716 return "PUT";
717
718 default:
719 return "?";
720 }
721 }
722
723
724 const char* Toolbox::ToString(HttpStatus status)
725 {
726 switch (status)
727 {
728 case HttpStatus_100_Continue:
729 return "Continue";
730
731 case HttpStatus_101_SwitchingProtocols:
732 return "Switching Protocols";
733
734 case HttpStatus_102_Processing:
735 return "Processing";
736
737 case HttpStatus_200_Ok:
738 return "OK";
739
740 case HttpStatus_201_Created:
741 return "Created";
742
743 case HttpStatus_202_Accepted:
744 return "Accepted";
745
746 case HttpStatus_203_NonAuthoritativeInformation:
747 return "Non-Authoritative Information";
748
749 case HttpStatus_204_NoContent:
750 return "No Content";
751
752 case HttpStatus_205_ResetContent:
753 return "Reset Content";
754
755 case HttpStatus_206_PartialContent:
756 return "Partial Content";
757
758 case HttpStatus_207_MultiStatus:
759 return "Multi-Status";
760
761 case HttpStatus_208_AlreadyReported:
762 return "Already Reported";
763
764 case HttpStatus_226_IMUsed:
765 return "IM Used";
766
767 case HttpStatus_300_MultipleChoices:
768 return "Multiple Choices";
769
770 case HttpStatus_301_MovedPermanently:
771 return "Moved Permanently";
772
773 case HttpStatus_302_Found:
774 return "Found";
775
776 case HttpStatus_303_SeeOther:
777 return "See Other";
778
779 case HttpStatus_304_NotModified:
780 return "Not Modified";
781
782 case HttpStatus_305_UseProxy:
783 return "Use Proxy";
784
785 case HttpStatus_307_TemporaryRedirect:
786 return "Temporary Redirect";
787
788 case HttpStatus_400_BadRequest:
789 return "Bad Request";
790
791 case HttpStatus_401_Unauthorized:
792 return "Unauthorized";
793
794 case HttpStatus_402_PaymentRequired:
795 return "Payment Required";
796
797 case HttpStatus_403_Forbidden:
798 return "Forbidden";
799
800 case HttpStatus_404_NotFound:
801 return "Not Found";
802
803 case HttpStatus_405_MethodNotAllowed:
804 return "Method Not Allowed";
805
806 case HttpStatus_406_NotAcceptable:
807 return "Not Acceptable";
808
809 case HttpStatus_407_ProxyAuthenticationRequired:
810 return "Proxy Authentication Required";
811
812 case HttpStatus_408_RequestTimeout:
813 return "Request Timeout";
814
815 case HttpStatus_409_Conflict:
816 return "Conflict";
817
818 case HttpStatus_410_Gone:
819 return "Gone";
820
821 case HttpStatus_411_LengthRequired:
822 return "Length Required";
823
824 case HttpStatus_412_PreconditionFailed:
825 return "Precondition Failed";
826
827 case HttpStatus_413_RequestEntityTooLarge:
828 return "Request Entity Too Large";
829
830 case HttpStatus_414_RequestUriTooLong:
831 return "Request-URI Too Long";
832
833 case HttpStatus_415_UnsupportedMediaType:
834 return "Unsupported Media Type";
835
836 case HttpStatus_416_RequestedRangeNotSatisfiable:
837 return "Requested Range Not Satisfiable";
838
839 case HttpStatus_417_ExpectationFailed:
840 return "Expectation Failed";
841
842 case HttpStatus_422_UnprocessableEntity:
843 return "Unprocessable Entity";
844
845 case HttpStatus_423_Locked:
846 return "Locked";
847
848 case HttpStatus_424_FailedDependency:
849 return "Failed Dependency";
850
851 case HttpStatus_426_UpgradeRequired:
852 return "Upgrade Required";
853
854 case HttpStatus_500_InternalServerError:
855 return "Internal Server Error";
856
857 case HttpStatus_501_NotImplemented:
858 return "Not Implemented";
859
860 case HttpStatus_502_BadGateway:
861 return "Bad Gateway";
862
863 case HttpStatus_503_ServiceUnavailable:
864 return "Service Unavailable";
865
866 case HttpStatus_504_GatewayTimeout:
867 return "Gateway Timeout";
868
869 case HttpStatus_505_HttpVersionNotSupported:
870 return "HTTP Version Not Supported";
871
872 case HttpStatus_506_VariantAlsoNegotiates:
873 return "Variant Also Negotiates";
874
875 case HttpStatus_507_InsufficientStorage:
876 return "Insufficient Storage";
877
878 case HttpStatus_509_BandwidthLimitExceeded:
879 return "Bandwidth Limit Exceeded";
880
881 case HttpStatus_510_NotExtended:
882 return "Not Extended";
883
884 default:
885 throw OrthancException(ErrorCode_ParameterOutOfRange);
886 }
887 }
888 } 700 }