summaryrefslogtreecommitdiffstats
path: root/src/kile/kileuntitled.cpp
blob: a949499111e06a000dd6c180be8fc236105c888b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// C++ Implementation: kileuntitled
//
// Description: 
//
//
// Author: Jeroen Wijnhout <[email protected]>, (C) 2005
//
// Copyright: See COPYING file that comes with this distribution
//
//

#include "kileuntitled.h"

#include <tqregexp.h>
#include <tdelocale.h>

TQString KileUntitled::m_untitled = i18n("Untitled");
int KileUntitled::m_last = -1;

bool KileUntitled::isUntitled(const TQString &str)
{
    static TQRegExp reUntitled(m_untitled + " [0-9]+.*");
    return reUntitled.exactMatch(str);
}

TQString KileUntitled::next()
{
    ++m_last;
    return current();
}

TQString KileUntitled::current()
{
    return m_untitled + ' ' + TQString::number(m_last);
}