Encode() public static method

public static Encode ( string str ) : string
str string
return string
Example #1
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + ",." + mBenchMark.ToString() +
            (string.IsNullOrEmpty(mValueSource) ? ".,$," : ".,'" + ParserIfc.Encode(mValueSource) + "',") +
            (mDataValue == null ? "$" : (mDataValue is BaseClassIfc o ? "#" + o.StepId : mDataValue.ToString())) +
            (mDatabase.Release < ReleaseVersion.IFC4 ? "" : ",#" + mReferencePath.StepId));
 }
Example #2
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + "," + formatLength(mOverallHeight) + "," + formatLength(mOverallWidth) +
            (release < ReleaseVersion.IFC4 ? "" : (mPredefinedType == IfcDoorTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType.ToString() + ".,") +
             (mOperationType == IfcDoorTypeOperationEnum.NOTDEFINED ? "$," : "." + SerializeDoorTypeOperation(mOperationType, release) + ".,") +
             (string.IsNullOrEmpty(mUserDefinedOperationType) ? "$" : ",'" + ParserIfc.Encode(mUserDefinedOperationType) + "'")));
 }
Example #3
0
        protected override string BuildStringSTEP(ReleaseVersion release)
        {
            string s = (release < ReleaseVersion.IFC4 ? "" : (string.IsNullOrEmpty(mName) ? ",$," : ",'" + ParserIfc.Encode(mName) + "',") +
                        (string.IsNullOrEmpty(mDescription) ? "$," : "'" + ParserIfc.Encode(mDescription) + "',") + (string.IsNullOrEmpty(mCategory) ? "$," : "'" + ParserIfc.Encode(mCategory) + "',") + ParserSTEP.DoubleOptionalToString(mPriority));

            return("#" + mMaterial.StepId + "," + ParserSTEP.DoubleToString(mLayerThickness) + "," + ParserIfc.LogicalToString(mIsVentilated) + s);
        }
Example #4
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return((string.IsNullOrEmpty(mIdentification) ? "$,'" : "'" + ParserIfc.Encode(mIdentification) + "','") + ParserIfc.Encode(Name)
            + (string.IsNullOrEmpty(mDescription) ? "',$," : "','" + ParserIfc.Encode(mDescription) + "',")
            + (mRoles.Count == 0 ? "$," : "(" + string.Join(",", Roles.Select(x => "#" + x.StepId)) + "),")
            + (mAddresses.Count == 0 ? "$" : "(" + string.Join(",", Addresses.Select(x => "#" + x.StepId)) + ")"));
 }
Example #5
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) +
            (release < ReleaseVersion.IFC4 ? "" :
             (mPredefinedType == IfcBuiltSystemTypeEnum.NOTDEFINED ? ",$," : ",." + mPredefinedType + ".,") +
             (string.IsNullOrEmpty(mLongName) ? "$" : "'" + ParserIfc.Encode(mLongName) + "'")));
 }
Example #6
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + "," + ParserSTEP.DoubleOptionalToString(mCompressiveStrength) + "," +
            ParserSTEP.DoubleOptionalToString(mMaxAggregateSize) +
            (string.IsNullOrEmpty(mAdmixturesDescription) ? ",$," : ",'" + ParserIfc.Encode(mAdmixturesDescription) + "',") +
            (string.IsNullOrEmpty(mWorkability) ? "$," : "'" + mWorkability + "',") + ParserSTEP.DoubleOptionalToString(mProtectivePoreRatio) +
            (string.IsNullOrEmpty(mWaterImpermeability) ? ",$" : ",'" + ParserIfc.Encode(mWaterImpermeability) + "'"));
 }
Example #7
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     if (release < ReleaseVersion.IFC4 || mMaterialProfiles.Count == 0)
     {
         return("");
     }
     return((string.IsNullOrEmpty(mName) ? "$," : "'" + ParserIfc.Encode(mName) + "',") + (string.IsNullOrEmpty(mDescription) ? "$,(#" : "'" + ParserIfc.Encode(mDescription) + "',(") + string.Join(",", mMaterialProfiles.Select(x => "#" + x.StepId)) + ")," + ParserSTEP.ObjToLinkString(mCompositeProfile));
 }
Example #8
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     if (mProperties.Count == 0)
     {
         return("");
     }
     return(base.BuildStringSTEP(release) + ",(#" + string.Join(",#", mProperties.Values.Select(x => x.StepId)) +
            (string.IsNullOrEmpty(mDescription) ? "),$,'" : "),'" + ParserIfc.Encode(mDescription) + "','") + ParserIfc.Encode(mName) + "'");
 }
Example #9
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     if (release < ReleaseVersion.IFC4)
     {
         return("");
     }
     return(base.BuildStringSTEP(release) + ",#" + mRelatingMaterial.StepId + ",(" +
            string.Join(",", mRelatedMaterials.Select(x => "#" + x.StepId)) +
            (string.IsNullOrEmpty(mMaterialExpression) ? "),$" : "),'" + ParserIfc.Encode(mMaterialExpression) + "'"));
 }
Example #10
0
        protected override string BuildStringSTEP(ReleaseVersion release)
        {
            string result = base.BuildStringSTEP(release);

            if (release < ReleaseVersion.IFC4)
            {
                return(result);
            }
            return(result + (string.IsNullOrEmpty(mDescription) ? ",$," : ",'" + ParserIfc.Encode(mDescription) + "',") +
                   (string.IsNullOrEmpty(mLanguage) ? "$," : "'" + ParserIfc.Encode(mLanguage) + "',") + ParserSTEP.ObjToLinkString(mReferencedLibrary));
        }
Example #11
0
        protected override string BuildStringSTEP(ReleaseVersion release)
        {
            string result = "'" + ParserIfc.Encode(mName) + (string.IsNullOrEmpty(mVersion) ? "',$," : "','" + ParserIfc.Encode(mVersion) + "',") +
                            (mPublisher == null? "$" : "#" + mPublisher.StepId);

            if (mDatabase.Release < ReleaseVersion.IFC4)
            {
                return(result + (mVersionDateSS == null ? ",$" : ",#" + mVersionDateSS.StepId) + ",(" + string.Join(",", mHasConstraintRelationships.Select(x => "#" + x.StepId)) + ")");
            }
            return(result + "," + IfcDateTime.STEPAttribute(mVersionDate) + "," +
                   (string.IsNullOrEmpty(mLocation) ? "$," : "'" + ParserIfc.Encode(mLocation) + "',") +
                   (string.IsNullOrEmpty(mDescription) ? "$" : "'" + ParserIfc.Encode(mDescription) + "'"));
        }
Example #12
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     if (mProperties.Count == 0)
     {
         return("");
     }
     if (release < ReleaseVersion.IFC4)
     {
         return("");
     }
     return((string.IsNullOrEmpty(mName) ? "$," : "'" + ParserIfc.Encode(mName) + "',")
            + (string.IsNullOrEmpty(mDescription) ? "$,(#" : "'" + ParserIfc.Encode(mDescription) + "',(#") + string.Join(",#", mProperties.Values.Select(x => x.StepId)) + ")");
 }
Example #13
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     if (release < ReleaseVersion.IFC4)
     {
         return("");               //to be implemented
     }
     return(base.BuildStringSTEP(release) + ",'" + ParserIfc.Encode(mIdentification) + "','" + ParserIfc.Encode(mName) +
            (string.IsNullOrEmpty(mDescription) ? "',$," :  "','" + ParserIfc.Encode(mDescription) + "',") +
            (release < ReleaseVersion.IFC4 ? (mDocumentReferences.Count == 0 ? "$," : "(#" + string.Join(",#", mDocumentReferences) + "),") :
             (string.IsNullOrEmpty(mLocation) ? "$," : "'" + ParserIfc.Encode(mLocation) + "',")) +
            (string.IsNullOrEmpty(mPurpose) ? "$," : "'" + ParserIfc.Encode(mPurpose) + "',") + (string.IsNullOrEmpty(mIntendedUse) ? "$," : "'" + ParserIfc.Encode(mIntendedUse) + "',") +
            (string.IsNullOrEmpty(mScope) ? "$," : "'" + ParserIfc.Encode(mScope) + "',") +
            (string.IsNullOrEmpty(mRevision) ? "$," : "'" + ParserIfc.Encode(mRevision) + "',") + ParserSTEP.LinkToString(mDocumentOwner) +
            (mEditors.Count == 0 ? ",$," : ",(#" + string.Join(",#", mEditors) + "),") + IfcDateTime.STEPAttribute(mCreationTime) + "," + IfcDateTime.STEPAttribute(mLastRevisionTime) + "," +
            (release < ReleaseVersion.IFC4 ? ParserSTEP.LinkToString(mSSElectronicFormat) : (string.IsNullOrEmpty(mElectronicFormat) ? "$" : "'" + ParserIfc.Encode(mElectronicFormat) + "'")) +
            (release < ReleaseVersion.IFC4 ? ",$,$" : "," + IfcDate.STEPAttribute(mValidFrom) + "," + IfcDate.STEPAttribute(mValidUntil)) +
            (mConfidentiality == IfcDocumentConfidentialityEnum.NOTDEFINED ? ",$," : ",." + mConfidentiality.ToString() + ".,") + (mStatus == IfcDocumentStatusEnum.NOTDEFINED ? "$" : "." + mStatus.ToString() + "."));
 }
Example #14
0
        internal string getHeaderString(string fileName)
        {
            string hdr = "ISO-10303-21;\r\nHEADER;\r\nFILE_DESCRIPTION(('ViewDefinition [" + viewDefinition + "]'),'2;1');\r\n";

            hdr += "FILE_NAME(\r\n";
            hdr += "/* name */ '" + ParserIfc.Encode(fileName.Replace("\\", "\\\\")) + "',\r\n";
            DateTime now = DateTime.Now;

            hdr += "/* time_stamp */ '" + now.Year + "-" + (now.Month < 10 ? "0" : "") + now.Month + "-" + (now.Day < 10 ? "0" : "") + now.Day + "T" + (now.Hour < 10 ? "0" : "") + now.Hour + ":" + (now.Minute < 10 ? "0" : "") + now.Minute + ":" + (now.Second < 10 ? "0" : "") + now.Second + "',\r\n";
            hdr += "/* author */ ('" + System.Environment.UserName + "'),\r\n";
            hdr += "/* organization */ ('" + IfcOrganization.Organization + "'),\r\n";
            hdr += "/* preprocessor_version */ '" + mFactory.ToolkitName + "',\r\n";
            hdr += "/* originating_system */ '" + mFactory.ApplicationFullName + "',\r\n";
            hdr += "/* authorization */ 'None');\r\n\r\n";
            hdr += "FILE_SCHEMA (('" + (mRelease == ReleaseVersion.IFC2x3 ? "IFC2X3" : "IFC4") + "'));\r\n";
            hdr += "ENDSEC;\r\n";
            hdr += "\r\nDATA;";
            return(hdr);
        }
Example #15
0
        internal string getHeaderString(string fileName)
        {
            string vd = (mModelView == ModelView.Ifc2x3Coordination ? "CoordinationView_V2" :
                         (mModelView == ModelView.Ifc4Reference ? "ReferenceView_V1" : (mModelView == ModelView.Ifc4DesignTransfer ? "DesignTransferView_V1" : "notYetAssigned")));
            string hdr = "ISO-10303-21;\r\nHEADER;\r\nFILE_DESCRIPTION(('ViewDefinition [" + vd + "]'),'2;1');\r\n";

            hdr += "FILE_NAME(\r\n";
            hdr += "/* name */ '" + ParserIfc.Encode(fileName.Replace("\\", "\\\\")) + "',\r\n";
            DateTime now = DateTime.Now;

            hdr += "/* time_stamp */ '" + now.Year + "-" + (now.Month < 10 ? "0" : "") + now.Month + "-" + (now.Day < 10 ? "0" : "") + now.Day + "T" + (now.Hour < 10 ? "0" : "") + now.Hour + ":" + (now.Minute < 10 ? "0" : "") + now.Minute + ":" + (now.Second < 10 ? "0" : "") + now.Second + "',\r\n";
            hdr += "/* author */ ('" + System.Environment.UserName + "'),\r\n";
            hdr += "/* organization */ ('Unknown'),\r\n";
            hdr += "/* preprocessor_version */ 'GeomGymIFC by Geometry Gym Pty Ltd',\r\n";
            hdr += "/* originating_system */ '" + applicationString + "',\r\n";

            hdr += "/* authorization */ 'None');\r\n\r\n";
            hdr += "FILE_SCHEMA (('" + (mSchema == Schema.IFC2x3 ? "IFC2X3" : "IFC4") + "'));\r\n";
            hdr += "ENDSEC;\r\n";
            hdr += "\r\nDATA;";
            return(hdr);
        }
Example #16
0
 public IfcURIReference(string value)
 {
     mValue = string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value);
 }
Example #17
0
 public IfcText(string value)
 {
     mValue = string.IsNullOrEmpty(value) ? "" : ParserIfc.Encode(value);
 }
Example #18
0
 public IfcIdentifier(string value)
 {
     mValue = ParserIfc.Encode(value);
 }
 internal string removeFileNameIllegal(string filename)
 {
     return(ParserIfc.Encode(filename).Replace("*", "x").Replace(".", "_").Replace("\"", "").Replace("/", "_").Replace("\\", "_").Replace("[", "(").Replace("]", ")").Replace(":", "-").Replace(";", "-").Replace("|", "-").Replace("=", "-").Replace(",", "_").Replace("<", "(").Replace(">", ")"));
 }
Example #20
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + (mLocation == "$" ? ",$," : ",'" + mLocation + "',") + (mIdentification == "$" ? "$" : "'" + mIdentification + "'") + (string.IsNullOrEmpty(mName) ? ",$" : ",'" + ParserIfc.Encode(mName) + "'"));
 }
Example #21
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(release < ReleaseVersion.IFC4 ? "" : base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + ".,." + mEventTriggerType.ToString() +
            (string.IsNullOrEmpty(mUserDefinedEventTriggerType) ? ".,$" : (".,'" + ParserIfc.Encode(mUserDefinedEventTriggerType) + "'")));
 }
Example #22
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 ? ",." + mCurrency + "." : ",'" + ParserIfc.Encode(mCurrency) + "'"));
 }
Example #23
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(release < ReleaseVersion.IFC4 ? base.BuildStringSTEP(release) + ",.NOTDEFINED.,.NOTDEFINED.," +
            ParserSTEP.BoolToString(mParameterTakesPrecedence) + "," + ParserSTEP.BoolToString(false) :
            base.BuildStringSTEP(release) + ",." + mPredefinedType.ToString() + ".,." + mPartitioningType.ToString() + ".," +
            ParserSTEP.BoolToString(mParameterTakesPrecedence) +
            (string.IsNullOrEmpty(mUserDefinedPartitioningType) ? ",$" : ",'" + ParserIfc.Encode(mUserDefinedPartitioningType) + "'"));
 }
Example #24
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + "," + formatLength(mOverallHeight) + "," + formatLength(mOverallWidth) +
            (release < ReleaseVersion.IFC4 ? "" : ",." + mPredefinedType + ".,." + mPartitioningType +
             (string.IsNullOrEmpty(mUserDefinedPartitioningType) ? ".,$" : ".,'" + ParserIfc.Encode(mUserDefinedPartitioningType) + "'")));
 }
Example #25
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + (string.IsNullOrEmpty(mIdentification) ? ",$," : ",'" + ParserIfc.Encode(mIdentification) + "',") + ParserSTEP.LinkToString(mOriginalValue) + "," + ParserSTEP.LinkToString(mCurrentValue) + "," +
            ParserSTEP.LinkToString(mTotalReplacementCost) + "," + ParserSTEP.LinkToString(mOwner) + "," +
            ParserSTEP.LinkToString(mUser) + "," + ParserSTEP.LinkToString(mResponsiblePerson) + "," +
            (mDatabase.Release < ReleaseVersion.IFC4 ? ParserSTEP.LinkToString(mIncorporationDateSS) : IfcDate.STEPAttribute(mIncorporationDate)) + "," + ParserSTEP.LinkToString(mDepreciatedValue));
 }
Example #26
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + ",(#" + string.Join(",#", OffsetValues.ConvertAll(x => x.Index)) + (string.IsNullOrEmpty(Tag) ? "),$" : "),'" + ParserIfc.Encode(Tag) + "'"));
 }
Example #27
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + (release < ReleaseVersion.IFC4 && (this as IfcDoorType != null || this as IfcWindowType != null) ? "" : (string.IsNullOrEmpty(mElementType) ? ",$" : ",'" + ParserIfc.Encode(mElementType) + "'")));
 }
Example #28
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + "," + ParserSTEP.DoubleToString(Math.Max(0, mLengthValue)) +
            (release < ReleaseVersion.IFC4 ? "" : (string.IsNullOrEmpty(mFormula) ? ",$" : ",'" + ParserIfc.Encode(mFormula) + "'")));
 }
Example #29
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + "," +
            (release < ReleaseVersion.IFC4X3 ? ParserSTEP.DoubleToString(CountValueDouble) : CountValue.ToString()) +
            (release < ReleaseVersion.IFC4 ? "" : (string.IsNullOrEmpty(mFormula) ? ",$" : ",'" + ParserIfc.Encode(mFormula) + "'")));
 }
Example #30
0
 protected override string BuildStringSTEP(ReleaseVersion release)
 {
     return(base.BuildStringSTEP(release) + ",'" + mImpactType + "',." + mEnvCategory.ToString() + ".," + (string.IsNullOrEmpty(mUserDefinedCategory) ? "$" : "'" + ParserIfc.Encode(mUserDefinedCategory) + "'"));
 }