Theory of directed localization in one dimension