Moved some in inline methods in ParamterOutput into the new ParamterOutput.cpp

file to clean up the interface.
This commit is contained in:
Robert Osfield 2003-01-11 12:50:39 +00:00
parent e8ddbdd195
commit ef7d7fce2e
4 changed files with 45 additions and 26 deletions

View File

@ -129,6 +129,10 @@ SOURCE=..\..\Src\osgDB\Output.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Src\osgDB\ParameterOutput.cpp
# End Source File
# Begin Source File
SOURCE=..\..\Src\osgDB\ReadFile.cpp
# End Source File
# Begin Source File

View File

@ -13,21 +13,13 @@ class OSGDB_EXPORT ParameterOutput
{
public:
ParameterOutput(Output& fw):
_fw(fw),
_numItemsPerLine(fw.getNumIndicesPerLine()),
_column(0) {}
ParameterOutput(Output& fw);
ParameterOutput(Output& fw,int numItemsPerLine):
_fw(fw),
_numItemsPerLine(numItemsPerLine),
_column(0) {}
ParameterOutput(Output& fw,int numItemsPerLine);
void begin()
{
_fw.indent() << "{"<<std::endl;
_fw.moveIn();
}
void begin();
void newLine();
void end();
template<class T>
void write(const T& t)
@ -73,19 +65,8 @@ class OSGDB_EXPORT ParameterOutput
}
void newLine()
{
if (_column!=0) _fw << std::endl;
_column = 0;
}
void end()
{
if (_column!=0) _fw << std::endl;
_fw.moveOut();
_fw.indent() << "}"<<std::endl;
_column = 0;
}
protected:
Output& _fw;
int _numItemsPerLine;

View File

@ -11,6 +11,7 @@ CXXFILES =\
WriteFile.cpp\
Input.cpp\
Output.cpp\
ParameterOutput.cpp\
Field.cpp\
FieldReader.cpp\
FieldReaderIterator.cpp\

View File

@ -0,0 +1,33 @@
#include <osgDB/ParameterOutput>
using namespace osgDB;
ParameterOutput::ParameterOutput(Output& fw):
_fw(fw),
_numItemsPerLine(fw.getNumIndicesPerLine()),
_column(0) {}
ParameterOutput::ParameterOutput(Output& fw,int numItemsPerLine):
_fw(fw),
_numItemsPerLine(numItemsPerLine),
_column(0) {}
void ParameterOutput::begin()
{
_fw.indent() << "{"<<std::endl;
_fw.moveIn();
}
void ParameterOutput::newLine()
{
if (_column!=0) _fw << std::endl;
_column = 0;
}
void ParameterOutput::end()
{
if (_column!=0) _fw << std::endl;
_fw.moveOut();
_fw.indent() << "}"<<std::endl;
_column = 0;
}