Files
graphify/tests/fixtures/sample.cpp
T
Safi 47e65658c7 bump version to 0.8.12 — security and wiki fixes
Security: _is_sensitive now flags underscore-prefixed names (api_token.txt, oauth_token.json) by replacing \b with lookarounds; adds _SENSITIVE_DIRS check on parent path components (parts[:-1]) so .ssh/, secrets/, .aws/ directories are always skipped; aligns both patterns to (?![a-zA-Z]) for consistent underscore-after-keyword behavior (#920)

Fix: --wiki Relationships section always empty because _cross_community_links read community from node attrs (always None) instead of the communities dict; _god_node_article had the same bug and never linked to the owning community; fixed by building a node->community map in to_wiki() and threading it through (#925)

Fix: --watch now respects .graphifyignore; patterns loaded once at startup, handler checks _is_ignored before extension filter so node_modules/, .venv/, build/ churn no longer triggers rebuilds (#928)

Fix: C++ struct inheritance edges via base_class_clause; initialize base="" per iteration to prevent stale carryover (#915)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-18 15:43:45 +01:00

44 lines
993 B
C++

#include <iostream>
#include <string>
#include <vector>
class HttpClient {
public:
HttpClient(const std::string& baseUrl) : baseUrl_(baseUrl) {}
std::string get(const std::string& path) {
return buildRequest("GET", path);
}
std::string post(const std::string& path, const std::string& body) {
return buildRequest("POST", path);
}
private:
std::string baseUrl_;
std::string buildRequest(const std::string& method, const std::string& path) {
return method + " " + baseUrl_ + path;
}
};
class AuthedHttpClient : public HttpClient {
public:
AuthedHttpClient(const std::string& baseUrl, const std::string& token)
: HttpClient(baseUrl), token_(token) {}
private:
std::string token_;
};
struct RetryingHttpClient : HttpClient {
int maxRetries;
};
int main() {
HttpClient client("https://api.example.com");
std::string response = client.get("/users");
std::cout << response << std::endl;
return 0;
}