core/PhraseCollection.h
author David Anderson <dvander@alliedmods.net>
Wed Feb 25 20:25:20 2009 -0500 (2009-02-25)
changeset 2613 46c76edb0875
parent 2042 4a2faafca477
permissions -rw-r--r--
Removed tag sourcemod-1.1.1
dvander@2042
     1
/**
dvander@2042
     2
 * vim: set ts=4 :
dvander@2042
     3
 * =============================================================================
dvander@2042
     4
 * SourceMod
dvander@2042
     5
 * Copyright (C) 2004-2008 AlliedModders LLC.  All rights reserved.
dvander@2042
     6
 * =============================================================================
dvander@2042
     7
 *
dvander@2042
     8
 * This program is free software; you can redistribute it and/or modify it under
dvander@2042
     9
 * the terms of the GNU General Public License, version 3.0, as published by the
dvander@2042
    10
 * Free Software Foundation.
dvander@2042
    11
 * 
dvander@2042
    12
 * This program is distributed in the hope that it will be useful, but WITHOUT
dvander@2042
    13
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
dvander@2042
    14
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
dvander@2042
    15
 * details.
dvander@2042
    16
 *
dvander@2042
    17
 * You should have received a copy of the GNU General Public License along with
dvander@2042
    18
 * this program.  If not, see <http://www.gnu.org/licenses/>.
dvander@2042
    19
 *
dvander@2042
    20
 * As a special exception, AlliedModders LLC gives you permission to link the
dvander@2042
    21
 * code of this program (as well as its derivative works) to "Half-Life 2," the
dvander@2042
    22
 * "Source Engine," the "SourcePawn JIT," and any Game MODs that run on software
dvander@2042
    23
 * by the Valve Corporation.  You must obey the GNU General Public License in
dvander@2042
    24
 * all respects for all other code used.  Additionally, AlliedModders LLC grants
dvander@2042
    25
 * this exception to all derivative works.  AlliedModders LLC defines further
dvander@2042
    26
 * exceptions, found in LICENSE.txt (as of this writing, version JULY-31-2007),
dvander@2042
    27
 * or <http://www.sourcemod.net/license.php>.
dvander@2042
    28
 *
dvander@2042
    29
 * Version: $Id$
dvander@2042
    30
 */
dvander@2042
    31
dvander@2042
    32
#ifndef _INCLUDE_SOURCEMOD_PHRASECOLLECTION_H_
dvander@2042
    33
#define _INCLUDE_SOURCEMOD_PHRASECOLLECTION_H_
dvander@2042
    34
dvander@2042
    35
#include <string.h>
dvander@2042
    36
#include <sh_vector.h>
dvander@2042
    37
#include <ITranslator.h>
dvander@2042
    38
dvander@2042
    39
using namespace SourceHook;
dvander@2042
    40
using namespace SourceMod;
dvander@2042
    41
dvander@2042
    42
class CPhraseCollection : public IPhraseCollection
dvander@2042
    43
{
dvander@2042
    44
public:
dvander@2042
    45
	CPhraseCollection();
dvander@2042
    46
	~CPhraseCollection();
dvander@2042
    47
public:
dvander@2042
    48
	IPhraseFile *AddPhraseFile(const char *filename);
dvander@2042
    49
	unsigned int GetFileCount();
dvander@2042
    50
	IPhraseFile *GetFile(unsigned int file);
dvander@2042
    51
	void Destroy();
dvander@2042
    52
	TransError FindTranslation(const char *key, unsigned int langid, Translation *pTrans);
dvander@2042
    53
	bool FormatString(
dvander@2042
    54
		char *buffer,
dvander@2042
    55
		size_t maxlength,
dvander@2042
    56
		const char *format,
dvander@2042
    57
		void **params,
dvander@2042
    58
		unsigned int numparams,
dvander@2042
    59
		size_t *pOutLength,
dvander@2042
    60
		const char **pFailPhrase);
dvander@2042
    61
private:
dvander@2042
    62
	CVector<IPhraseFile *> m_Files;
dvander@2042
    63
};
dvander@2042
    64
dvander@2042
    65
#endif //_INCLUDE_SOURCEMOD_PHRASECOLLECTION_H_