/*********************************************************************
 * This file is part of the cpplibs suite.
 *
 * Copyright (C) 2001 Topi Mäenpää
 * All rights reserved.
 *
 * This program is free software. You can redistribute and/or modify
 * it under the terms of the free software licence found in the
 * accompanying file "COPYING". The licence terms must always be
 * redistributed with this source file. The above copyright notice
 * must be reproduced in all modified and unmodified copies of this
 * source file.
 *
 * $Revision: 1.7 $
 *********************************************************************/

#include "List.h"
#include "Number.h"

using namespace std;

namespace util
{
	template <> void List<std::string>::addElements(int count,...)
	{
		if (_iCurrentItems + count > _iSize)
			{
				int size = _iSize;
				while (_iCurrentItems + count > size) size += _iBlockSize;
				enlargeArray(size);
			}
		va_list argp;
		// initalize var ptr
		va_start(argp, count); 

		// repeat for each arg
		while (count--)
			addElement(std::string(va_arg(argp,const char*)));

		// done with args
		va_end(argp);
	}
}
