2019-01-02 00:55:51 -05:00
|
|
|
// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
2018-06-04 09:25:26 -04:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Tools.DotNETCommon.Perforce
|
|
|
|
|
{
|
2018-06-05 13:27:00 -04:00
|
|
|
public static class PerforceUtils
|
2018-06-04 09:25:26 -04:00
|
|
|
{
|
|
|
|
|
static public string EscapePath(string Path)
|
|
|
|
|
{
|
|
|
|
|
string NewPath = Path;
|
|
|
|
|
NewPath = NewPath.Replace("%", "%25");
|
|
|
|
|
NewPath = NewPath.Replace("*", "%2A");
|
|
|
|
|
NewPath = NewPath.Replace("#", "%23");
|
|
|
|
|
NewPath = NewPath.Replace("@", "%40");
|
|
|
|
|
return NewPath;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static public string UnescapePath(string Path)
|
|
|
|
|
{
|
|
|
|
|
string NewPath = Path;
|
|
|
|
|
NewPath = NewPath.Replace("%40", "@");
|
|
|
|
|
NewPath = NewPath.Replace("%23", "#");
|
|
|
|
|
NewPath = NewPath.Replace("%2A", "*");
|
|
|
|
|
NewPath = NewPath.Replace("%2a", "*");
|
|
|
|
|
NewPath = NewPath.Replace("%25", "%");
|
|
|
|
|
return NewPath;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|