blob: c93ce6ed27278c88e2a304ae1af9341179339cd2 (
plain) (
tree)
|
|
/*
* Copyright (c) 2014 Contributor. All rights reserved.
*/
package scala.tools.nsc.classpath
import scala.tools.nsc.classpath.FlatClassPath.RootPackage
/**
* Common methods related to package names represented as String
*/
object PackageNameUtils {
/**
* @param fullClassName full class name with package
* @return (package, simple class name)
*/
def separatePkgAndClassNames(fullClassName: String): (String, String) = {
val lastDotIndex = fullClassName.lastIndexOf('.')
if (lastDotIndex == -1)
(RootPackage, fullClassName)
else
(fullClassName.substring(0, lastDotIndex), fullClassName.substring(lastDotIndex + 1))
}
}
|