protected VariablePathBase(string pathString) :
                base(pathString)
            {
                Debug.Assert(pathString != null);
                Debug.Assert(pathString.Length > 0);
                Debug.Assert(pathString.IsNormalized());

                Debug.Assert(m_PathString != null);
                Debug.Assert(m_PathString.Length > 0);
                Debug.Assert(m_PathString.IsNormalized());

                // It is important to use m_PathString and not pathString in IsAVariablePath() !
                // Indeed, since InnerSpecialDir have been resolved, some variable might have disappeared
                // like if pathString was "$(v1)\$(v2)\.." and m_PathString became "$(v1)"
                IReadOnlyList <string> variables;
                string failureReasonUnused;
                var    b = VariablePathHelpers.IsAVariablePath(m_PathString, out variables, out failureReasonUnused);

                Debug.Assert(b);
                Debug.Assert(variables != null);
                Debug.Assert(variables.Count > 0);
                Debug.Assert(variables.All(v => v != null));
                Debug.Assert(variables.All(v => v.Length > 0));
                m_Variables = variables;
            }
Пример #2
0
            protected VariablePathBase(string path)
                : base(path)
            {
                //Debug.Assert(path.IsNormalized());

                //Debug.Assert(CurrentPath != null);
                //Debug.Assert(CurrentPath.Length > 0);
                //Debug.Assert(CurrentPath.IsNormalized());

                // It is important to use m_PathString and not pathString in IsAVariablePath() !
                // Indeed, since InnerSpecialDir have been resolved, some variable might have disappeared
                // like if pathString was "$(v1)\$(v2)\.." and m_PathString became "$(v1)"
                IReadOnlyList <string> variables;
                string failureMessage;

                VariablePathHelpers.IsAVariablePath(CurrentPath, out variables, out failureMessage);

                //Debug.Assert(b);
                //Debug.Assert(variables != null);
                //Debug.Assert(variables.Count > 0);
                //Debug.Assert(variables.All(v => v != null));
                //Debug.Assert(variables.All(v => v.Length > 0));

                AllVariables = variables;
            }