Changeset 16220


Ignore:
Timestamp:
2008-06-27T10:51:20+12:00 (15 years ago)
Author:
mdewsnip
Message:

Added the last of the "-split_using_hierarchy_separator" code.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/src/recpt/dynamicclassifieraction.cpp

    r16219 r16220  
    223223  if (classifier_options["-split_greenstone_dates"] == "1")
    224224  {
    225     classifier_node_metadata_value.replace("|", "");
     225    classifier_node_metadata_value.replace (classifier_node_separator, "");
    226226    classifier_node_metadata_value_filter = classifier_node_metadata_value;
    227227    if (classifier_node_metadata_value_filter.size() == 8)
     
    518518{
    519519  text_t hierarchical_metadata_value = metadata_value;
    520 
    521   // Add hierarchy separators into Greenstone date values (YYYYMMDD -> YYYY|MM|DD)
     520  text_t hierarchy_separator = classifier_options["-split_using_hierarchy_separator"];
     521
     522  // Add hierarchy separators into Greenstone date values (e.g. YYYYMMDD -> YYYY|MM|DD)
    522523  if (classifier_options["-split_greenstone_dates"] == "1")
    523524  {
     
    525526    {
    526527      // Add year
    527       hierarchical_metadata_value = substr(metadata_value.begin(), metadata_value.begin() + 4);
     528      hierarchical_metadata_value = substr (metadata_value.begin(), metadata_value.begin() + 4);
    528529      if (metadata_value.size() == 6 || metadata_value.size() == 8)
    529530      {
    530531    // Add month
    531     hierarchical_metadata_value += "|" + substr(metadata_value.begin() + 4, metadata_value.begin() + 6);
     532    hierarchical_metadata_value += hierarchy_separator;
     533    hierarchical_metadata_value += substr (metadata_value.begin() + 4, metadata_value.begin() + 6);
    532534    if (metadata_value.size() == 8)
    533535    {
    534536      // Add day
    535       hierarchical_metadata_value += "|" + substr(metadata_value.begin() + 6, metadata_value.begin() + 8);
     537      hierarchical_metadata_value += hierarchy_separator;
     538      hierarchical_metadata_value += substr (metadata_value.begin() + 6, metadata_value.begin() + 8);
    536539    }
    537540      }
Note: See TracChangeset for help on using the changeset viewer.