Internals: Add const's. No functional change intended.

Signed-off-by: Wilson Snyder <wsnyder@wsnyder.org>
This commit is contained in:
John Coiner 2017-10-26 18:42:50 -04:00 committed by Wilson Snyder
parent c17a9eb5f1
commit 4e98d96755
2 changed files with 7 additions and 7 deletions

View File

@ -274,18 +274,18 @@ void V3Graph::dumpEdge(ostream& os, V3GraphVertex* vertexp, V3GraphEdge* edgep)
}
}
void V3Graph::dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph) {
void V3Graph::dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph) const {
if (v3Global.opt.dumpTree()) {
dumpDotFile(v3Global.debugFilename(nameComment)+".dot", colorAsSubgraph);
}
}
//! Variant of dumpDotFilePrefixed without --dump option check
void V3Graph::dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph) {
void V3Graph::dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph) const {
dumpDotFile(v3Global.debugFilename(nameComment)+".dot", colorAsSubgraph);
}
void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) {
void V3Graph::dumpDotFile(const string& filename, bool colorAsSubgraph) const {
// This generates a file used by graphviz, http://www.graphviz.org
// "hardcoded" parameters:
const vl_unique_ptr<ofstream> logp (V3File::new_ofstream(filename));

View File

@ -65,7 +65,7 @@ public:
V3Graph();
virtual ~V3Graph();
static void debug(int level) { s_debug = level; }
virtual string dotRankDir() { return "TB"; } // rankdir for dot plotting
virtual string dotRankDir() const { return "TB"; } // rankdir for dot plotting
// METHODS
void clear(); // Empty it of all vertices/edges, as if making a new object
@ -127,9 +127,9 @@ public:
/// Debugging
void dump(ostream& os=cout);
void dumpDotFile(const string& filename, bool colorAsSubgraph);
void dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph=false);
void dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph=false);
void dumpDotFile(const string& filename, bool colorAsSubgraph) const;
void dumpDotFilePrefixed(const string& nameComment, bool colorAsSubgraph=false) const;
void dumpDotFilePrefixedAlways(const string& nameComment, bool colorAsSubgraph=false) const;
void userClearVertices();
void userClearEdges();
static void test();