Skip to content
Commit af296cce authored by Oliver Kellogg's avatar Oliver Kellogg
Browse files

lib/cppparser/driver.cpp cosmetics in class Driver::ParseHelper :

- At constructor insert linebreaks in member initializer list to avoid
  overlong line.
- Factor constructor body into separate function init().
  Reason: Constructors shall be light weight to remove risk of
  calls before end of construction not acting as expected
  (dynamic dispatch will only work on fully constructed objects).
- In order to do this, add member variables for use in the init
  function:
  - bool m_reportMessages  (assigned from ctor arg reportMessages);
  - QString m_includedFrom (assigned from ctor arg includedFrom).
- Add member QString m_fileContent to capture return value from
    m_driver->sourceProvider()->contents(m_fileName)
  to remove risk of temporary QString object premature deconstruction
  at call to m_lex.setSource().
- In Driver functions addDependence and parseFile call init() on
  local variable of type ParseHelper.
parent e9a62e38
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment