Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Script / Serialization / JavaScriptString.cs / 1305376 / JavaScriptString.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Serialization { using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Text; internal class JavaScriptString { private string _s; private int _index; internal JavaScriptString(string s) { _s = s; } internal NullableGetNextNonEmptyChar() { while (_s.Length > _index) { char c = _s[_index++]; if (!Char.IsWhiteSpace(c)) { return c; } } return null; } internal Nullable MoveNext() { if (_s.Length > _index) { return _s[_index++]; } return null; } internal string MoveNext(int count) { if (_s.Length >= _index + count) { string result = _s.Substring(_index, count); _index += count; return result; } return null; } internal void MovePrev() { if (_index > 0) { _index--; } } internal void MovePrev(int count) { while (_index > 0 && count > 0) { _index--; count--; } } public override string ToString() { if (_s.Length > _index) { return _s.Substring(_index); } return String.Empty; } internal string GetDebugString(string message) { return message + " (" + _index + "): " + _s; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SqlDependencyListener.cs
- AmbientProperties.cs
- HybridDictionary.cs
- ResourcesBuildProvider.cs
- ConfigXmlSignificantWhitespace.cs
- Simplifier.cs
- FixedSOMTableRow.cs
- DynamicDocumentPaginator.cs
- VirtualPathExtension.cs
- ConfigXmlAttribute.cs
- SafeHandles.cs
- BooleanAnimationUsingKeyFrames.cs
- PeerPresenceInfo.cs
- XmlSchemaSubstitutionGroup.cs
- NameValueCache.cs
- SqlCacheDependencyDatabaseCollection.cs
- ResourceExpressionBuilder.cs
- SessionStateContainer.cs
- PrimitiveDataContract.cs
- MD5Cng.cs
- LineMetrics.cs
- FactoryGenerator.cs
- VirtualPathUtility.cs
- DataGridViewCellParsingEventArgs.cs
- GlobalProxySelection.cs
- Line.cs
- TemplateControl.cs
- Soap12ProtocolReflector.cs
- ByteStorage.cs
- BaseCodeDomTreeGenerator.cs
- CodeExporter.cs
- CultureTable.cs
- CoreSwitches.cs
- SafeFileMappingHandle.cs
- HtmlValidatorAdapter.cs
- LineGeometry.cs
- DataFieldConverter.cs
- TableHeaderCell.cs
- PartBasedPackageProperties.cs
- SeparatorAutomationPeer.cs
- Command.cs
- AnnotationHighlightLayer.cs
- XmlTextWriter.cs
- OleDbError.cs
- TreeViewItem.cs
- DataSourceSerializationException.cs
- MimeWriter.cs
- PolicyException.cs
- CodeArrayIndexerExpression.cs
- CustomPopupPlacement.cs
- DBBindings.cs
- ListViewUpdateEventArgs.cs
- WindowsImpersonationContext.cs
- CodeArgumentReferenceExpression.cs
- Debug.cs
- DesignerVerbCollection.cs
- BindingMemberInfo.cs
- XmlSerializerFactory.cs
- OpenTypeCommon.cs
- Stackframe.cs
- UnmanagedHandle.cs
- RowToFieldTransformer.cs
- CryptoStream.cs
- DiscriminatorMap.cs
- objectquery_tresulttype.cs
- UserPrincipalNameElement.cs
- OleDbDataReader.cs
- InboundActivityHelper.cs
- XsltArgumentList.cs
- Module.cs
- ApplicationProxyInternal.cs
- SimpleWorkerRequest.cs
- XmlBinaryReader.cs
- ReflectionHelper.cs
- PreservationFileWriter.cs
- SqlDataSource.cs
- ListBase.cs
- OverlappedAsyncResult.cs
- CodeGenerationManager.cs
- AspNetCompatibilityRequirementsMode.cs
- OutputCacheProfileCollection.cs
- CodeEntryPointMethod.cs
- AnimationException.cs
- Funcletizer.cs
- VerificationAttribute.cs
- ObjectStateFormatter.cs
- MaterialCollection.cs
- DetailsViewRow.cs
- UnSafeCharBuffer.cs
- MessageDispatch.cs
- ConcurrentQueue.cs
- BasePattern.cs
- XmlLanguageConverter.cs
- IRCollection.cs
- CompiledQueryCacheEntry.cs
- RawUIStateInputReport.cs
- ControlEvent.cs
- RuntimeConfig.cs
- CommandLibraryHelper.cs
- NavigationCommands.cs