Files
Custom-Operating-System/libs/libfoundation/src/URL.cpp

20 lines
429 B
C++
Raw Normal View History

2025-02-12 09:54:05 -05:00
#include <libfoundation/URL.h>
#include <string>
namespace LFoundation {
URL::Scheme URL::parse_scheme(const std::string& path)
{
if (path.starts_with("file://")) {
return Scheme::File;
} else if (path.starts_with("http://")) {
return Scheme::Http;
} else if (path.starts_with("https://")) {
return Scheme::Https;
}
// Unknown scheme.
std::abort();
}
} // namespace LFoundation