Esempio n. 1
0
        public void GEDCOMUtils_Tests()
        {
            GEDCOMObject obj = new GEDCOMObject();

            obj.ExtData = this;
            Assert.AreEqual(obj.ExtData, this);
            obj.Dispose();

            //

            Assert.AreEqual("I12", GEDCOMUtils.CleanXRef("@I12@"), "CleanXRef(@I12@)");
            Assert.AreEqual("@I12@", GEDCOMUtils.EncloseXRef("I12"), "EncloseXRef(I12)");

            //
            string s1 = " 12345 efgh";
            string s2 = "";

            s2 = GEDCOMUtils.ExtractDelimiter(s1, 0);
            Assert.AreEqual("12345 efgh", s2);

            //

            string s3 = GEDCOMUtils.ExtractDelimiter("    abrvalg", 2);

            Assert.AreEqual("  abrvalg", s3);
        }
Esempio n. 2
0
        public override string ParseString(string strValue)
        {
            string result = strValue;

            if (!string.IsNullOrEmpty(result))
            {
                result = GEDCOMUtils.ExtractDelimiter(result, 0);
                if (result.Substring(0, 3).ToUpperInvariant() == "INT")
                {
                    result = result.Remove(0, 3);
                }
                result = GEDCOMUtils.ExtractDelimiter(result, 0);
                result = base.ParseString(result);
                result = GEDCOMUtils.ExtractDelimiter(result, 0);
                result = ExtractPhrase(result);
            }
            return(result);
        }
Esempio n. 3
0
        public override string ParseString(string strValue)
        {
            fStringValue = "";
            XRef         = "";
            string result = strValue;

            if (!string.IsNullOrEmpty(result))
            {
                result = GEDCOMUtils.ExtractDelimiter(result, 0);
                result = base.ParseString(result);
                if (!IsPointer)
                {
                    fStringValue = result;
                    result       = "";
                }
            }
            return(result);
        }
Esempio n. 4
0
        public override string ParseString(string strValue)
        {
            fXRef = "";
            string result = strValue;

            result = GEDCOMUtils.ExtractDelimiter(result, 0);

            if (!string.IsNullOrEmpty(result) && result[0] == '@' && result[1] != '#')
            {
                int pos = result.IndexOf('@', 2);
                if (pos > 0)
                {
                    pos++;
                    fXRef  = result.Substring(0, pos);
                    result = result.Remove(0, pos);
                }
            }
            return(result);
        }