home *** CD-ROM | disk | FTP | other *** search
/ Collection of Internet / Collection of Internet.iso / msdos / lynx / source / doslynx / src / textattr.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-25  |  1.4 KB  |  40 lines

  1. //    Copyright (c) 1994, University of Kansas, All Rights Reserved
  2. //
  3. //    Class:        TextAttribute
  4. //    Include File:    textattr.h
  5. //    Purpose:    Implement a way of giving a WWW style of attribute to
  6. //            a segment of a stream of data.
  7. //    Remarks/Portability/Dependencies/Restrictions:
  8. //        The difference between the start and end of an attribute is
  9. //        called extent.  Extent can be considered a correlation to
  10. //        calling strlen on a string.
  11. //        An extent of 0 means no duration, 1 means 1 byte, etc...
  12. //        A negative extent is equivalent to 0 extent.
  13. //        Once an attribute type is set by the constructor, it can
  14. //        never be changed.
  15. //    Revision History:
  16. //        02-01-94    created
  17. //        02-09-94    Split all members into seperate files.
  18. #include"textattr.h"
  19.  
  20. unsigned char TextAttribute::inRange(const signed long int sli_Offset)
  21.     const    {
  22. //    Purpose:    Decide if an offset is within the anchor.
  23. //    Arguments:    sli_Offset    The offset to check and see if in
  24. //                    range.
  25. //    Return Value:    unsigned char    == 1    In side of the attribute.
  26. //                    == 0    Not in side of the attribute.
  27. //    Remarks/Portability/Dependencies/Restrictions:
  28. //        An extent of 0 means no duration; always fail.
  29. //        The end offset into the stream is actually always considered
  30. //        one past the bytes affected by the attribute.
  31. //    Revision History:
  32. //        02-01-94    created
  33.  
  34.     if(getExtent() == 0L)
  35.         return(0);
  36.  
  37.     if(sli_StreamOffset <= sli_Offset && sli_StreamExtent > sli_Offset)
  38.         return(1);
  39.     return(0);
  40. }