Example #1
0
        void _uidUrl(string nUrl)
        {
            string url_ = nUrl.Substring(6);

            if (null == url_ || @"" == url_)
            {
                mUrlType = UrlType_.mError_;
                return;
            }
            int             pos0_      = url_.IndexOf(@"/");
            int             pos1_      = url_.IndexOf(@"\");
            int             pos2_      = url_.IndexOf(@"*");
            int             pos3_      = url_.IndexOf(@":");
            SortedSet <int> sortedSet_ = new SortedSet <int>();

            sortedSet_.Add(pos0_);
            sortedSet_.Add(pos1_);
            sortedSet_.Add(pos2_);
            sortedSet_.Add(pos3_);
            int beg_ = -1;

            foreach (int i in sortedSet_)
            {
                if (i > 0)
                {
                    beg_ = i;
                    break;
                }
            }
            string name_ = null;
            string left_ = null;

            if (beg_ < 0)
            {
                name_ = url_;
            }
            else
            {
                name_ = url_.Substring(0, beg_);
                left_ = url_.Substring(beg_);
            }
            UidSingleton uidSingleton_ = __singleton <UidSingleton> ._instance();

            Uid    uid_        = uidSingleton_._getUid(name_);
            Uid    optimalUid_ = uid_._getUid();
            string uidUrl_     = optimalUid_._getOptimal();

            if (null != left_)
            {
                uidUrl_ += left_;
            }
            mUrlStruct = new UrlStruct();
            mUrlStruct._parserUrl(uidUrl_);
            mUrlType = UrlType_.mUid_;
        }
Example #2
0
 void _urlUrl(string nUrl)
 {
     mUrlStruct = new UrlStruct();
     mUrlStruct._parserUrl(nUrl);
     mUrlType = UrlType_.mUrl_;
 }