package Common::XMLFileWriter;

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#   Copyright RoyaltyShare, Inc. 2005
#   All Rights Reserved.  Licensed Software.
#
#   THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF RoyaltyShare, Inc.
#   The copyright notice above does not evidence any actual or
#   intended publication of such source code.
#
#   PROPRIETARY INFORMATION, PROPERTY OF RoyaltyShare, Inc.
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#    $Id$
#    $Source$
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

# you can change these to empty strings to save file size and parse time.
use constant XML_INDENT_STRING => "  ";
use constant XML_NEWLINE       => "\n";

use strict;
use warnings;
use Carp;

use lib '/app/tools/common/lib';
use Common::XMLWriter;
use base 'Common::XMLWriter';

sub new {
    my ( $class, $fileHandle ) = @_;

    my $self = bless {}, $class;

    return $self->_init( fh => $fileHandle );
}

sub _init {
    my ( $self, %args ) = @_;

    $self->SUPER::_init(%args);

    $self->{_fh} = $args{fh};

    return $self;
}

sub _addToXML {
    my ( $self, $stringToAdd ) = @_;

    if ( defined $stringToAdd ) {
        my $fh = $self->{_fh};
        print $fh $stringToAdd;
    }
}

###
1;    # Play nicely.
###
