Skip to content

Commit 7c180d6

Browse files
author
Clement Champetier
committed
Option: rename getChild to getChildAtIndex
1 parent ed0345f commit 7c180d6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

app/optionChecker/optionChecker.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,16 @@ void displayOptions( const std::vector<avtranscoder::Option>& options )
4848
std::cout << "Default choice index: " << option.getDefaultChildIndex() << std::endl;
4949
for(size_t i = 0; i < option.getChilds().size(); ++i )
5050
std::cout << "Choice " << i << ": " <<
51-
option.getChild( i ).getName() << " // " <<
52-
option.getChild( i ).getHelp() << std::endl;
51+
option.getChildAtIndex( i ).getName() << " // " <<
52+
option.getChildAtIndex( i ).getHelp() << std::endl;
5353
}
5454
else if( option.getType() == avtranscoder::eOptionBaseTypeGroup )
5555
{
5656
std::cout << "Nb choices: " << option.getChilds().size() << std::endl;
5757
for(size_t i = 0; i < option.getChilds().size(); ++i )
5858
std::cout << "Element " << i << ": " <<
59-
option.getChild( i ).getName() << " // " <<
60-
option.getChild( i ).getDefaultValueBool() << std::endl;
59+
option.getChildAtIndex( i ).getName() << " // " <<
60+
option.getChildAtIndex( i ).getDefaultValueBool() << std::endl;
6161
}
6262
}
6363
}

src/AvTranscoder/option/Option.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class Option
7373
// array of childs
7474
bool hasChild() const { return ! _childOptions.empty(); }
7575
const std::vector<Option>& getChilds() { return _childOptions; }
76-
const Option& getChild( size_t index ) { return _childOptions.at( index ); }
76+
const Option& getChildAtIndex( const size_t index ) const { return _childOptions.at( index ); }
7777
int getDefaultChildIndex() const { return _defaultChildIndex; }
7878

7979
void setDefaultChildIndex( size_t index ) { _defaultChildIndex = index; }

0 commit comments

Comments
 (0)