MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / GetStream

Method GetStream

Sources/Shared/IO/WebRequest.cpp:806–826  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

804 }
805
806 Stream* WebResponseImpl::GetStream() const
807 {
808 if (_stream == nullptr) {
809 switch (_request.GetStorage()) {
810 case WebRequest::Storage::Memory: {
811 _stream = std::make_unique<MemoryStream>(_readBuffer.data(), _readBuffer.size());
812 break;
813 }
814 case WebRequest::Storage::File: {
815 _stream = std::make_unique<FileStream>(_file->GetPath(), FileAccess::Read);
816 break;
817 }
818 case WebRequest::Storage::None: {
819 // Stream is disabled
820 break;
821 }
822 }
823 }
824
825 return _stream.get();
826 }
827
828 String WebResponseImpl::GetSuggestedFileName() const
829 {

Callers 3

Calls 6

DEATH_ASSERTFunction · 0.85
GetStorageMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
GetPathMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected