Remove useless space after list "[" first item
This commit is contained in:
parent
f5f257685c
commit
c5ce75b9ee
4
Makefile
4
Makefile
|
@ -41,10 +41,10 @@ $(BUILDDIR)/%.$(OBJEXT): $(SRCDIR)/%.$(SRCEXT)
|
|||
$(CXX) $(CXXFLAGS) -c $^ -o $@
|
||||
|
||||
libupdfparser.a: $(OBJECTS)
|
||||
$(AR) crs $@ obj/*.o
|
||||
$(AR) crs $@ $^
|
||||
|
||||
libupdfparser.so: $(OBJECTS)
|
||||
$(CXX) obj/*.o $(LDFLAGS) -o $@ -shared
|
||||
$(CXX) $^ $(LDFLAGS) -o $@ -shared
|
||||
|
||||
test: tests/test.cpp libupdfparser.a
|
||||
g++ -ggdb -O0 $^ -o $@ -Iinclude libupdfparser.a
|
||||
|
|
|
@ -73,13 +73,28 @@ namespace uPDFParser
|
|||
|
||||
for(it = _value.begin(); it!=_value.end(); it++)
|
||||
{
|
||||
if (res.size() > 1 &&
|
||||
(*it)->type() != DataType::TYPE::INTEGER &&
|
||||
(*it)->type() != DataType::TYPE::REAL)
|
||||
res += " ";
|
||||
res += (*it)->str();
|
||||
/* These types has already a space in front */
|
||||
if ((*it)->type() != DataType::TYPE::INTEGER &&
|
||||
(*it)->type() != DataType::TYPE::REAL &&
|
||||
(*it)->type() != DataType::TYPE::REFERENCE)
|
||||
{
|
||||
if (res.size() > 1)
|
||||
res += " ";
|
||||
res += (*it)->str();
|
||||
}
|
||||
else
|
||||
{
|
||||
if (res.size() > 1)
|
||||
res += (*it)->str();
|
||||
/* First time, remove front space*/
|
||||
else
|
||||
res += (*it)->str().substr(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (res.size() == 1)
|
||||
res += " ";
|
||||
|
||||
return res + "]";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user