Skip to content

Use ostream parameter instead of cout in SQL dump functions#85

Merged
dspinellis merged 1 commit intodspinellis:masterfrom
sanki92:fix-dumpsql-ostream
Mar 4, 2026
Merged

Use ostream parameter instead of cout in SQL dump functions#85
dspinellis merged 1 commit intodspinellis:masterfrom
sanki92:fix-dumpsql-ostream

Conversation

@sanki92
Copy link
Contributor

@sanki92 sanki92 commented Mar 4, 2026

Fdep::dumpSql() writes directly to cout, unlike the other dump functions (workdb_schema, workdb_rest, Call::dumpSql) which write to the ostream& parameter. This makes it impossible to redirect its output to a different stream.

Changes

  • fdep.h / fdep.cpp: added ostream &of parameter to Fdep::dumpSql() and replaced all cout usage with of
  • cscout.cpp: updated the call site to pass cout
  • call.cpp: fixed two places where cout was used instead of of when writing NULL metric values (lines 308, 318)

Verification

Existing behavior is unchanged, the call site still passes cout, so all SQL output goes to the same destination as before. The fix just makes it possible to redirect when needed.

Closes #82 (partially)

cc: @dspinellis

@dspinellis
Copy link
Owner

Great; well done!

@dspinellis dspinellis merged commit acb8a3c into dspinellis:master Mar 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow CScout to work as a Visual Studio Code plugin (GSoC 2026)

2 participants