bool Volta::hasEnding(int repeat) const { for (int ending : endings()) { if (ending == repeat) return true; } return false; }
QVariant Volta::getProperty(P_ID propertyId) const { switch (propertyId) { case P_ID::VOLTA_ENDING: return QVariant::fromValue(endings()); default: break; } return TextLineBase::getProperty(propertyId); }
static Vector<std::pair<int, String>> getRegularExpressionMatchesByLines(const RegularExpression& regex, const String& text) { Vector<std::pair<int, String>> result; if (text.isEmpty()) return result; OwnPtr<Vector<size_t>> endings(lineEndings(text)); size_t size = endings->size(); unsigned start = 0; for (size_t lineNumber = 0; lineNumber < size; ++lineNumber) { size_t lineEnd = endings->at(lineNumber); String line = text.substring(start, lineEnd - start); if (line.endsWith('\r')) line = line.left(line.length() - 1); int matchLength; if (regex.match(line, 0, &matchLength) != -1) result.append(std::pair<int, String>(lineNumber, line)); start = lineEnd + 1; } return result; }
static Vector<pair<int, String> > getScriptRegexpMatchesByLines(const ScriptRegexp* regex, const String& text) { Vector<pair<int, String> > result; if (text.isEmpty()) return result; OwnPtr<Vector<unsigned> > endings(lineEndings(text)); unsigned size = endings->size(); unsigned start = 0; for (unsigned lineNumber = 0; lineNumber < size; ++lineNumber) { unsigned lineEnd = endings->at(lineNumber); String line = text.substring(start, lineEnd - start); if (line.endsWith('\r')) line = line.left(line.length() - 1); int matchLength; if (regex->match(line, 0, &matchLength) != -1) result.append(pair<int, String>(lineNumber, line)); start = lineEnd + 1; } return result; }
QStringList FileExtensions() { QStringList endings(QObject::tr("html")); endings << QString("htm"); return endings; }
CheckoutOptionsPage::CheckoutOptionsPage(wxWindow* parent, ModuleBasicsPage* moduleBasicsPage) : wxPanel(parent), myModuleBasicsPage(moduleBasicsPage) { wxBoxSizer *sizer = new wxBoxSizer(wxVERTICAL); SetAutoLayout(TRUE); SetSizer(sizer); // Input widgets sizer->Add(0, 4); wxStaticBox* staticBox = new wxStaticBox(this, -1, _("Purpose of checkout")); wxStaticBoxSizer* sizerStaticBox = new wxStaticBoxSizer(staticBox, wxVERTICAL); const wxChar* tip3 = _("Prevents creation of CVS admin folders"); myCheckoutRadioButton = new wxRadioButton(this, CHECKOUTOPTIONSPAGE_ID_CHECKOUT, _("&Checkout - for working on the module"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); myCheckoutRadioButton->SetValue(true); myExportRadioButton = new wxRadioButton(this, CHECKOUTOPTIONSPAGE_ID_EXPORT, _("&Export - for making a software release") ); sizerStaticBox->Add( myCheckoutRadioButton, 0, wxGROW | wxALL, 4); sizerStaticBox->Add( myExportRadioButton, 0, wxGROW | wxALL, 4); myExportRadioButton->SetToolTip(tip3); sizer->Add(sizerStaticBox, 0, wxGROW | wxALL, 4); sizer->Add(0, 10); #ifdef MARCH_HARE_BUILD const wxChar* tip5 = _( "Normally TortoiseCVS will checkout files so they can be modified. \ If you check this, TortoiseCVS will set the files to read-only and you can use the Edit option to make them changeable."); myReadOnlyCheck = new wxCheckBox(this, -1, _("Check out read only")); myReadOnlyCheck->SetToolTip(tip5); sizer->Add(myReadOnlyCheck, 0, wxGROW | wxALL, 4); #endif wxStaticBox* staticBox2 = new wxStaticBox(this, -1, _("Name of folder to create") ); wxStaticBoxSizer* sizerStaticBox2 = new wxStaticBoxSizer(staticBox2, wxVERTICAL); const wxChar* tip1 = _("Use this name instead of module name for the new folder"); myModuleDirRadioButton = new wxRadioButton(this, CHECKOUTOPTIONSPAGE_ID_MODULEDIR, _("Use &default folder name"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP); myModuleDirRadioButton->SetValue(true); myModuleTagDirRadioButton = new wxRadioButton(this, CHECKOUTOPTIONSPAGE_ID_MODULETAGDIR, _("Use &module name and tag/branch/revision as folder name")); myAltDirRadioButton = new wxRadioButton(this, CHECKOUTOPTIONSPAGE_ID_ALTDIR, _("Enter your own &folder name")); sizerStaticBox2->Add( myModuleDirRadioButton, 0, wxGROW | wxALL, 4); sizerStaticBox2->Add( myModuleTagDirRadioButton, 0, wxGROW | wxALL, 4); sizerStaticBox2->Add( myAltDirRadioButton, 0, wxGROW | wxALL, 4); myAltDirRadioButton->SetToolTip(tip1); wxBoxSizer *horzSizer = new wxBoxSizer(wxHORIZONTAL); myAltDirLabel = new wxStaticText(this, -1, _("Custom folder name:")); horzSizer->Add( myAltDirLabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 4); myAltDirEntry = new wxTextCtrl(this, -1, wxT("")); horzSizer->Add( myAltDirEntry, 1, wxGROW | wxALL | wxALIGN_CENTER_VERTICAL, 4); myAltDirEntry->SetToolTip(tip1); myAltDirLabel->SetToolTip(tip1); sizerStaticBox2->Add( horzSizer, 0, wxGROW | wxALL, 2); sizer->Add( sizerStaticBox2, 0, wxGROW | wxALL, 4); sizer->Add(0, 10); const wxChar* tip4 = _( "Normally, text files checked out on Windows will use CRLF as the line ending. \ If you check this, TortoiseCVS will use UNIX line endings (LF only)."); myUnixLinesCheck = new wxCheckBox(this, -1, _("Use UNIX &line endings")); myUnixLinesCheck->SetToolTip(tip4); sizer->Add(myUnixLinesCheck, 0, wxGROW | wxALL, 4); wxCommandEvent event; Refresh(event); }