Skip to content

Instantly share code, notes, and snippets.

@rightson
Last active March 23, 2016 05:18
Show Gist options
  • Save rightson/63af4ce70c7ffd8459e0 to your computer and use it in GitHub Desktop.
Save rightson/63af4ce70c7ffd8459e0 to your computer and use it in GitHub Desktop.
class WebBrowser {
public:
// ...
void clearCache();
void clearHistory();
void removeCookies();
// ...
};
class WebBrowser {
public:
// ...
void clearEverything(); // calls clearCache, clearHistory, removeCookies
// ...
};
void clearBrowser(WebBrowser& wb) {
wb.clearCache();
wb.clearHistory();
wb.removeCookies();
}
namespace WebBrowserStuff {
class WebBrowser { ... };
void clearBrowser(WebBrowser& wb);
}
// header "webbrowser.h" — header for class WebBrowser itself
// as well as "core" WebBrowser-related functionality
namespace WebBrowserStuff {
class WebBrowser { ... };
// "core" related functionality,
// e.g. non-member functions almost all clients need
}
// header "webbrowserbookmarks.h"
namespace WebBrowserStuff {
// bookmark-related convenience functions
}
// header "webbrowsercookies.h"
namespace WebBrowserStuff {
// cookie-related convenience functions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment