PhoenixPresentation  2.0.0
Set of cmake function to automate presentation generation
value_completion.h File Reference
#include "PString.h"
+ Include dependency graph for value_completion.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

PString value_completion (const PString &baseValue, const PVecString &vecPossibleValue)
 Complete the given value. More...
 

Function Documentation

◆ value_completion()

PString value_completion ( const PString baseValue,
const PVecString vecPossibleValue 
)

Complete the given value.

Parameters
baseValue: base value to be completed
vecPossibleValue: vector of possible values to be used
Returns
completed PString

Definition at line 14 of file value_completion.cpp.

14  {
15  PString strBashCompletion(""), separator("");
16  if(baseValue == ""){
17  for(PVecString::const_iterator it(vecPossibleValue.begin()); it != vecPossibleValue.end(); ++it){
18  strBashCompletion += separator + *it;
19  separator = " ";
20  }
21  }else{
22  for(PVecString::const_iterator it(vecPossibleValue.begin()); it != vecPossibleValue.end(); ++it){
23  if(it->isSameBegining(baseValue)){
24  strBashCompletion += separator + *it;
25  separator = " ";
26  }
27  }
28  }
29  return strBashCompletion;
30 }
Extends the std::string.
Definition: PString.h:16

Referenced by OptionValue::bashCompletionValue().

+ Here is the caller graph for this function: