#pragma once #include namespace roro::gemini { enum class Category { Input, Success, Redirect, TemporaryFailure, PermanentFailure, ClientCertificate, Unknown }; // The response header: " ", at most 1024 bytes of meta. struct Header { int status = 0; std::string meta; Category category() const; bool sensitiveInput() const { return status == 11; } // 2x: the MIME type, lower-cased, without parameters ("text/gemini" when meta is empty). std::string mimeType() const; std::string parameter(const std::string& name) const; // e.g. "charset" }; bool parseHeader(const std::string& line, Header& out); } // namespace roro::gemini