Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Unified Diff: pkg/analysis_services/lib/src/correction/strings.dart

Issue 484733003: Import analysis_services.dart into analysis_server.dart. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_services/lib/src/correction/strings.dart
diff --git a/pkg/analysis_services/lib/src/correction/strings.dart b/pkg/analysis_services/lib/src/correction/strings.dart
deleted file mode 100644
index a72b6f6837bc3dbdd5e47bb23bfb4df03b3e3c6c..0000000000000000000000000000000000000000
--- a/pkg/analysis_services/lib/src/correction/strings.dart
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-library services.src.correction.strings;
-
-
-/**
- * "$"
- */
-const int CHAR_DOLLAR = 0x24;
-
-/**
- * "."
- */
-const int CHAR_DOT = 0x2E;
-
-/**
- * "_"
- */
-const int CHAR_UNDERSCORE = 0x5F;
-
-
-String capitalize(String str) {
- if (isEmpty(str)) {
- return str;
- }
- return str.substring(0, 1).toUpperCase() + str.substring(1);
-}
-
-int compareStrings(String a, String b) {
- if (a == b) {
- return 0;
- }
- if (a == null) {
- return 1;
- }
- if (b == null) {
- return -1;
- }
- return a.compareTo(b);
-}
-
-/**
- * Checks if [str] is `null`, empty or is whitespace.
- */
-bool isBlank(String str) {
- if (str == null) {
- return true;
- }
- if (str.isEmpty) {
- return true;
- }
- return str.codeUnits.every(isSpace);
-}
-
-bool isDigit(int c) {
- return c >= 0x30 && c <= 0x39;
-}
-
-bool isEmpty(String str) {
- return str == null || str.isEmpty;
-}
-
-bool isLetter(int c) {
- return (c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A);
-}
-
-bool isLetterOrDigit(int c) {
- return isLetter(c) || isDigit(c);
-}
-
-bool isLowerCase(int c) {
- return c >= 0x61 && c <= 0x7A;
-}
-
-bool isSpace(int c) => c == 0x20 || c == 0x09;
-
-bool isUpperCase(int c) {
- return c >= 0x41 && c <= 0x5A;
-}
-
-bool isWhitespace(int c) {
- return isSpace(c) || c == 0x0D || c == 0x0A;
-}
-
-String remove(String str, String remove) {
- if (isEmpty(str) || isEmpty(remove)) {
- return str;
- }
- return str.replaceAll(remove, '');
-}
-
-String removeStart(String str, String remove) {
- if (isEmpty(str) || isEmpty(remove)) {
- return str;
- }
- if (str.startsWith(remove)) {
- return str.substring(remove.length);
- }
- return str;
-}
-
-String repeat(String s, int n) {
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < n; i++) {
- sb.write(s);
- }
- return sb.toString();
-}
« no previous file with comments | « pkg/analysis_services/lib/src/correction/statement_analyzer.dart ('k') | pkg/analysis_services/lib/src/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698