Commit Graph

137 Commits

Author SHA1 Message Date
Tyler Dauwalder 09b4d458da Initial checkin. BPrivate::Storage::Mime::AssociatedTypes class, which
is responsible for managing associations between mime types and
file extensions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1146 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-24 05:20:30 +00:00
Tyler Dauwalder e3a2f2069e + Added SetSupportedTypes() test
+ Modified BMimeType::SetSupportedTypes functionality so it keeps track of
stranded types (i.e. previously supported types that have not had the now
unsupporting app signature removed from their supporting apps list yet due
to a false fullSync parameter) over consecutive SetSupportedTypes(...,
false) calls and updates all appropriate stranded types on the next
SetSupportedTypes(..., true) call.
+ Added fullSync parameter to BMimeType::DeleteSupportedTypes
+ Made BMimeType::Delete() do a DeleteSupportedTypes(..., true) call to
properly update the supporting apps lists when a mime type is deleted.
+ Added initial BMimeType::Get/SetSnifferRule
+ Updated BMimeType::CheckSnifferRule() to return B_BAD_VALUE when passed
a NULL rule string.
+ Brought CheckSnifferRule() tests up to date
+ Added lots of Mime::Database doxygen
+ Added any missing mime monitor notifications in Mime::Database
+ Possibly made some other changes as well... :-)


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1004 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-09-09 08:12:03 +00:00
Tyler Dauwalder b86972c240 Added GetSupportingApps() message field constants
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@924 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 23:58:08 +00:00
Tyler Dauwalder 41b9ba9155 Added GetSupportingApps()/SetSupportedTypes() functionality
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@923 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 23:57:30 +00:00
Tyler Dauwalder ee0cf10184 Handles supporting application management. This is an
initial, theoretically fully functional implementation.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@919 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-28 23:52:52 +00:00
Tyler Dauwalder 02fd0582dd Cleaned up warnings
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@900 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-27 08:26:33 +00:00
Tyler Dauwalder 32f45afc26 + Added GetInstalled[Super]Types functionality
+ Cleaned up warnings
+ Added documentation


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@899 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-27 08:26:11 +00:00
Tyler Dauwalder 537842b6ee Split into storage/mime/* files, and thus removed
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@863 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-24 05:05:01 +00:00
Tyler Dauwalder e20a514ae9 After implementing the BMimeType::GetInstalled[Super]Types()
functionality, it became apparent that some restructuring was
needed if I wanted to keep things clean and managble.
storage/MimeDatabase.{h,cpp} have been broken into:

storage/mime/database_support.{h,cpp}
+ MIME database constants
+ high-level database access functions like open_type(),
  read_mime_attr(), etc.

storage/mime/database_access.{h,cpp}
+ atomic read functions
+ is_installed()
+ get_icon_data()

storage/mime/Database.{h,cpp}
+ Mime::Database class, which is responsible for all write,
  non-atomic read, and mime monitor functionality.

storage/mime/InstalledTypes.{h,cpp}
+ Helper class for Mime::Database::GetInstalled[Super]Types()

storage/mime/Supertype.{h,cpp}
+ Helper class for Mime::InstalledTypes

I haven't merged my intial, somewhat cludgy GetInstalled[Super]Types
implementation into the new setup yet. That comes next, and it ought
to be a more graceful implementation now.

I also implemented BMimeType::Get/SetSupportingTypes(), though
they haven't been tested yet (sorry).


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@862 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-24 05:04:02 +00:00
Tyler Dauwalder 1c4b41005c Added to_lower() functions
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@861 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-24 04:54:52 +00:00
Tyler Dauwalder 3155eae222 + Added code/updated tests for
- AttrInfo
  - FileExtensions
+ Updated Delete() code to send monitor updates
+ Tenatively added "be:action" field to monitor messages
+ Added data type constants


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@847 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-21 10:55:20 +00:00
Tyler Dauwalder 1ed04c7ce3 Added code for:
+ {Get,Set}IconForType()
+ Delete*() functions


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@834 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-20 09:37:04 +00:00
Tyler Dauwalder 55f345fd20 + Added code for:
- {Get,Set}PreferredApp()
  - {Get,Set}AppHint()
  - {Get,Set}Icon()
+ Added any missing doxygen

SetIcon() is currently not implemented as I would like,
due to us needing an OBOS::BBitmap implementation.
Thus there are two versions and the GetIconData()
function until that day comes around.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@818 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-19 08:37:50 +00:00
Tyler Dauwalder 9f3d4851ac Initial checkin; MimeDatabase class used to handle all actual mime
database access.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@785 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-16 22:00:37 +00:00
Tyler Dauwalder 09d84e61b6 + Changed StorageKit namespace to BPrivate::Storage
+ Changed Sniffer namespace to BPrivate::Storage::Sniffer


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@714 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-12 08:42:01 +00:00
Tyler Dauwalder 82b7566525 Updated header guards to Be, Inc. style.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@713 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-12 07:24:02 +00:00
Tyler Dauwalder 93d145bb01 + Added support for "-i" flags and case insensitive matching
+ Renamed Expr class to DisjList, which is more descriptive
  as to its function
+ Added ' and " to the list of allowed characters in an
  unquoted string.
+ Added updated sniffer rule grammar to doxygen for the
  Parser class


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@685 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-10 09:36:00 +00:00
Tyler Dauwalder 0322e71475 Renamed to DisjList.h
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@684 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-10 09:32:03 +00:00
Tyler Dauwalder fe70cd16af + Updated all the parsing code to use std::strings everywhere
instead of const char*'s to allow for rules with NULL characters
  embedded in them.
+ Updated Rule::Sniff() to actually return a useful value


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@662 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-09 10:30:38 +00:00
Tyler Dauwalder 60ee71d302 + Added some documentation
+ Fixed a bug with 0eXXX floats being handled improperly
+ Updated a few error messages to give proper character
  stream positions.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@650 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-08 07:23:24 +00:00
Tyler Dauwalder 0bc621d53b + Added some documentation
+ Now verifies the given priority is valid


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@649 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-08 07:21:31 +00:00
Tyler Dauwalder 10db8711a8 Added some documentation
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@648 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-08 07:20:47 +00:00
Tyler Dauwalder 390dce8da6 Parser is finished (or very nearly so)!!! :-)
+ Added support for extended notation floating point numbers,
as well as signed (+ and -) floats.
+ Finished up parsing code
+ Moved Err class into it's own header/source pair, since I
started using it all over the place in the sniffer code.
+ Did my darndest to make sure I wasn't leaking memory
anywhere.
+ Matched up error messages as best as possible with R5's
error message. Some couldn't be matched, some were improved.

There *are* a few things left to do. I don't think priorities are
verified to be valid (0.0 <= x <= 1.0). More tests also need to
be written. Things have solidified enough now that documentation
is a reasonable thing to start considering as well.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@608 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-06 08:37:14 +00:00
Tyler Dauwalder 01293d6ed7 + Added InitCheck()
+ Added Priority()
+ Added Sniff()
+ Replaced ExprList typedef with plain old std::vector<Expr*>
so I wouldn't forget what the hell kind of list I was working with.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@607 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-06 08:32:27 +00:00
Tyler Dauwalder 9d97f52d8d Added InitCheck() and GetErr()
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@606 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-06 08:30:44 +00:00
Tyler Dauwalder a60032821f Updated the Sniff() function to take a BPositionIO instead of BFile.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@603 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-06 08:28:36 +00:00
Tyler Dauwalder 74cd43ec44 New mime sniffer support classes
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@601 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-08-06 08:25:41 +00:00
Tyler Dauwalder 68faee1082 + Switched to std::vector in favor of BList
+ Added a few minor tweaks


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@532 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-29 07:03:23 +00:00
Tyler Dauwalder 4574a75fc5 + Got rid of global TokenStream object
+ Started on Parser class
+ Moved parsing functions into Parser class
+ Added Pos() member to Err class to allow for
snazzy BMimeType::CheckSnifferRule() error strings.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@531 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-29 07:01:56 +00:00
Tyler Dauwalder 0be1fe8a1f New MIME Sniffer files
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@529 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-29 06:57:11 +00:00
Tyler Dauwalder 224e92720e Added "position in original character stream" marker to Token class
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@490 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-28 04:13:30 +00:00
Tyler Dauwalder 5da549240a + Moved internally used classes into header to allow for testing.
+ Added EmptyToken, Integer, and FloatingPoint TokenTypes.
+ Added IntToken and IntegerToken classes.
+ Updated scanner, which now handles numbers as well. I believe
it's nearly complete, although I'm almost positive it doesn't
handle octals correctly yet...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@477 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-27 19:24:05 +00:00
Tyler Dauwalder 674e18fb18 Initial MIME sniffer rule parser checkin. The first draft of the
scanner portion of the parser is done, but completely untested
and unused. More to come...


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@452 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-26 07:47:07 +00:00
Tyler Dauwalder 5ebee1cf0a BVolume and BVolumeRoster updates, courtesty of Vincent Dominguez
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@405 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-23 21:39:49 +00:00
Ingo Weinhold 64f6603fbe Include the official DataIO.h rather than MallocIO.h.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@26 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 01:59:18 +00:00
Ingo Weinhold 232067ccbb Moved StorageDefs.Private.h to the public headers. Strange, but it is needed by them.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@21 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-10 01:47:48 +00:00
ejakowatz 52a3801208 It is accomplished ...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-09 12:24:59 +00:00