Skip to content

Commit e2fa17f

Browse files
committed
Add 'const' to list getters in IProjectReader
Resolves: #416
1 parent 18f4617 commit e2fa17f

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

src/internal/iprojectreader.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ class IProjectReader
3131
virtual bool loadData(const std::string &data) = 0;
3232
virtual bool isValid() = 0;
3333
virtual void clear() = 0;
34-
virtual const std::vector<std::shared_ptr<Target>> &targets() = 0;
35-
virtual const std::vector<std::shared_ptr<Broadcast>> &broadcasts() = 0;
36-
virtual const std::vector<std::shared_ptr<Monitor>> &monitors() = 0;
37-
virtual const std::vector<std::string> &extensions() = 0;
34+
virtual const std::vector<std::shared_ptr<Target>> &targets() const = 0;
35+
virtual const std::vector<std::shared_ptr<Broadcast>> &broadcasts() const = 0;
36+
virtual const std::vector<std::shared_ptr<Monitor>> &monitors() const = 0;
37+
virtual const std::vector<std::string> &extensions() const = 0;
3838
virtual const std::string &userAgent() const = 0;
3939

4040
protected:

src/internal/scratch3reader.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,22 +527,22 @@ void Scratch3Reader::clear()
527527
m_extensions.clear();
528528
}
529529

530-
const std::vector<std::shared_ptr<Target>> &Scratch3Reader::targets()
530+
const std::vector<std::shared_ptr<Target>> &Scratch3Reader::targets() const
531531
{
532532
return m_targets;
533533
}
534534

535-
const std::vector<std::shared_ptr<Broadcast>> &Scratch3Reader::broadcasts()
535+
const std::vector<std::shared_ptr<Broadcast>> &Scratch3Reader::broadcasts() const
536536
{
537537
return m_broadcasts;
538538
}
539539

540-
const std::vector<std::shared_ptr<Monitor>> &Scratch3Reader::monitors()
540+
const std::vector<std::shared_ptr<Monitor>> &Scratch3Reader::monitors() const
541541
{
542542
return m_monitors;
543543
}
544544

545-
const std::vector<std::string> &Scratch3Reader::extensions()
545+
const std::vector<std::string> &Scratch3Reader::extensions() const
546546
{
547547
return m_extensions;
548548
}

src/internal/scratch3reader.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ class Scratch3Reader : public IProjectReader
1717
bool loadData(const std::string &data) override;
1818
bool isValid() override;
1919
void clear() override;
20-
const std::vector<std::shared_ptr<Target>> &targets() override;
21-
const std::vector<std::shared_ptr<Broadcast>> &broadcasts() override;
22-
const std::vector<std::shared_ptr<Monitor>> &monitors() override;
23-
const std::vector<std::string> &extensions() override;
20+
const std::vector<std::shared_ptr<Target>> &targets() const override;
21+
const std::vector<std::shared_ptr<Broadcast>> &broadcasts() const override;
22+
const std::vector<std::shared_ptr<Monitor>> &monitors() const override;
23+
const std::vector<std::string> &extensions() const override;
2424
const std::string &userAgent() const override;
2525

2626
private:

0 commit comments

Comments
 (0)