Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 18a2753

Browse files
committed
Remove leading newlines from user-oriented output
They don't make much sense and make it harder to be parsed. Even though user-oriented output is not meant to be parsed, it is very common to have user-oriented output be more or less machine-friendly. It actually is the case of the Parameter Framework's remote commands, except for these leading newlines. Signed-off-by: David Wagner <[email protected]>
1 parent 05a80ea commit 18a2753

File tree

6 files changed

+0
-24
lines changed

6 files changed

+0
-24
lines changed

parameter/ConfigurableDomain.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,6 @@ bool CConfigurableDomain::deleteConfiguration(const string &strName, string &str
686686

687687
void CConfigurableDomain::listAssociatedToElements(string &strResult) const
688688
{
689-
strResult = "\n";
690-
691689
ConfigurableElementListIterator it;
692690

693691
// Browse all configurable elements

parameter/ConfigurableDomains.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,6 @@ bool CConfigurableDomains::split(const string &domainName, CConfigurableElement
317317

318318
void CConfigurableDomains::listAssociatedElements(string &strResult) const
319319
{
320-
strResult = "\n";
321-
322320
std::set<const CConfigurableElement *> configurableElementSet;
323321

324322
// Get all owned configurable elements
@@ -341,8 +339,6 @@ void CConfigurableDomains::listAssociatedElements(string &strResult) const
341339

342340
void CConfigurableDomains::listConflictingElements(string &strResult) const
343341
{
344-
strResult = "\n";
345-
346342
std::set<const CConfigurableElement *> configurableElementSet;
347343

348344
// Get all owned configurable elements
@@ -369,8 +365,6 @@ void CConfigurableDomains::listConflictingElements(string &strResult) const
369365

370366
void CConfigurableDomains::listDomains(string &strResult) const
371367
{
372-
strResult = "\n";
373-
374368
// List domains
375369
size_t uiNbConfigurableDomains = getNbChildren();
376370

parameter/ConfigurableElement.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -468,8 +468,6 @@ void CConfigurableElement::listBelongingDomains(std::string &strResult, bool bVe
468468
// Elements with no domains
469469
void CConfigurableElement::listRogueElements(std::string &strResult) const
470470
{
471-
strResult = "\n";
472-
473471
// Get rogue element aggregate list (no associated domain)
474472
std::list<const CConfigurableElement *> rogueElementList;
475473

@@ -568,11 +566,6 @@ void CConfigurableElement::listDomains(
568566
const std::list<const CConfigurableDomain *> &configurableDomainList, std::string &strResult,
569567
bool bVertical) const
570568
{
571-
if (bVertical && configurableDomainList.empty()) {
572-
573-
strResult = "\n";
574-
}
575-
576569
// Fill list
577570
ConfigurableDomainListConstIterator it;
578571
bool bFirst = true;

parameter/Element.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ string CElement::dumpContent(utility::ErrorContext &errorContext, const size_t d
122122
// Element properties
123123
void CElement::showProperties(string &strResult) const
124124
{
125-
strResult = "\n";
126125
strResult += "Kind: " + getKind() + "\n";
127126
showDescriptionProperty(strResult);
128127
}
@@ -330,8 +329,6 @@ bool CElement::removeChild(CElement *pChild)
330329

331330
void CElement::listChildren(string &strChildList) const
332331
{
333-
strChildList = "\n";
334-
335332
// Get list of children names
336333
for (CElement *pChild : _childArray) {
337334

parameter/ParameterMgr.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,8 +1370,6 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listElementsCommand
13701370
return CCommandHandler::EFailed;
13711371
}
13721372

1373-
strResult = string("\n");
1374-
13751373
if (!pLocatedElement) {
13761374

13771375
// List from root folder
@@ -1399,8 +1397,6 @@ CParameterMgr::CCommandHandler::CommandStatus CParameterMgr::listParametersComma
13991397
return CCommandHandler::EFailed;
14001398
}
14011399

1402-
strResult = string("\n");
1403-
14041400
if (!pLocatedElement) {
14051401

14061402
// List from root folder

remote-processor/RemoteCommandHandlerTemplate.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,6 @@ class TRemoteCommandHandlerTemplate : public IRemoteCommandHandler
194194
{
195195
initMaxCommandUsageLength();
196196

197-
strResult = "\n";
198-
199197
// Show usages
200198
for (const auto *pRemoteCommandParserItem : _remoteCommandParserVector) {
201199

0 commit comments

Comments
 (0)